[Math] Rudin Principles of Mathematical Analysis: Chapter 4 problem 18.

proof-verificationreal-analysis

Question: Every rational $x$ can be written in the form $x =\frac mn$ where $n>0$ and $m$ and $n$ are integers without common divisors. When $x =0$ we take $n = 1$. Consider the function defined on $R$ by
\begin{align} \\
f(x) =
\begin{cases}
0 & x\ \text {is irrational} \\
\frac 1n & x = \frac {m}{n}
\end {cases} \end{align}

Then prove that $f$ is continuous at every irrational point.

Proof: Let $x\in R-Q$ and Assume that there exists $\epsilon > 0$ such that for every $\delta > 0$ there exists $m, n \in {Z}$ and $n > 0$ such that $|\frac mn – x| < \delta$ and $|f(\frac mn)| \ge \epsilon$, where $\frac mn$ is it's simplest form. Then for every $\delta = \frac 1z$($z \in N$) there exists $m_z,n_z \in Z$,where $n_z > 0$, such that $|\frac {m_z}{n_z} – x| < \delta$ and $|\frac {1}{n_z}| \ge \epsilon$. The sequence defined by $y_z = \frac {m_z}{n_z}$ is convergent and $\lim\; y_z = x$. Now we have $\frac {|m_z|}{n_z} \ge |m_z|\epsilon$ and so $\frac {|x|}{\epsilon} \ge \lim\sup\ |m_z| \ge 0$. Therefore $|m_z|$ and $|n_z|$ are bounded and so the range of $\{y_z\}$ is finite, which is a contradiction. The case where we consider irrationals in the neighbourhood of $x$ is a trivial case as $f(y) = 0$, for every $y\in R-Q$. Therefore $f$ is continuous at every irrational point.

Best Answer

At first, it seems correct for me.

$\textbf{A little alternative ideia:}$

Let $a \in \mathbb{R\setminus Q}$. For $\epsilon > 0$ (arbitrary), the set of $\frac{1}{n} \geq \epsilon$ is finite, that is, the set of $x = \frac{m}{n}$ such that $f(x) = \frac{1}{n} \geq \epsilon$ is finite. Thus, we can take $\delta>0$ such that this points are not in $(a - \delta, a + \delta)$ (just take $\delta$ equal to the shortest distance of $a$ to one of these points). Then $x \in (a - \delta, a + \delta) \Longrightarrow 0 \leq |f(x)| < \epsilon$, so $$\lim_{x\to a} f(x) = 0 = f(a).$$

$\textbf{A curiosity:}$ The set of the discontinuity points of $f$ (that is, $\mathbb{Q}$) is a null set, then $f$ is a integrable function.