[Math] Showing that the Dirichlet function has no limit

limitsproof-verificationreal-analysis

Let $f(x) = 0$ if $x$ is rational and $f(x)=1$ if $x$ is irrational. Prove that $\lim_{x\to a} f(x)$ does not exist for any $a$.

Proof attempt:

Let $a\in\mathbb{R}$.
The only two possible values for a limit of $\lim_{x\to a}f(x)$ are $0,1$, since otherwise there will always be a constant gap between the valules of $f$ and the limit, and hence $f$ would not get arbitrarily small.

However, $\lim_{x\to a}f(x) \not = 1$ for the following reason: Set $\epsilon = 1/2$ and let $\delta > 0$. Then there exists a rational number $x_0$ in $0<|x_0-a|<\delta$ by the density of the rationals. However, $|f(x_0)-1| = |0-1| = 1 \not < 1/2$, and so $\lim_{x\to a}f(x) \not = 1$.

Also, $\lim_{x\to a}f(x) \not = 0$ for the following reason: Set $\epsilon = 1/2$ and let $\delta > 0$. Then there exists a irrational number $x_0$ in $0<|x_0-a|<\delta$ by the density of the irrationals. However, $|f(x_0)-0| = |1-0| = 1 \not < 1/2$, and so $\lim_{x\to a}f(x) \not = 0$.

Best Answer

Your proof is complete and fine. Only one minor correction : "hence $f$ would not get arbitrarily small" should be changed to "hence $f$ would not get arbitrarily close to the possible limit", in the first paragraph of the proof (or changed to "hence $f-L$ would not get arbitrarily small, where $L \neq 0,1$ is a possible limit").

There is another proof that will avoid the breaking of $L$ into cases : indeed, given $a \in \mathbb R$, by density of rationals and irrationals, there is a sequence of rationals and irrationals converging to $a$. But, $\lim_{x \to a} f(x)$ exists if and only if for any two sequences $a_n, b_n \to a$ we have $\lim a_n = \lim b_n$, and here the sequence of rationals and irrationals produce different values, namely $0$ and $1$.