$\epsilon{\rm -}\delta$ proof of the discontinuity of Dirichlet's function

Solution 1:

Let $x_0\ne 0$ be fixed. Informally, $f$ is continuous at $x_0$ would mean that $f(x)$ can be made as close to $f(x_0)$ as desired by taking $x$ sufficiently close to $x_0$. With the epsilon business, this means that $\color{maroon}{ \text{for every}}$ $\epsilon>0$, there is a $\delta>0$ such that $$\tag{1} \underbrace{|f(x_0)-f(x)|<\epsilon}_{f(x)\text{ is close to }f(x_0)} \quad\text{ whenever }\quad \underbrace{|x-x_0|<\delta\phantom{f}}_{x\text{ is close to }x_0}.$$

If $f$ were not continuous at $x_0$, this would mean that there $\color{maroon}{ \text{is some}}$ $\epsilon>0$ such that no matter what $\delta$ you choose, equation $(1)$ is not true. Informally, this means that no matter how close you take $x$ to $x_0$, you are not guaranteed that $f(x)$ is close to $f(x_0)$ and, in fact, you can find an $x$ as close to $x_0$ as you wish with $f(x)$ "far" away from $f(x_0)$.

So you need to show the following is true:

S: There is some $\epsilon>0$ such that for every $\delta>0$, there is a $x_1$ such that both $|x_1- x_0|<\delta$ and $|f(x_1)-f(x_0)|\ge \epsilon$.

Well, how to accomplish this? Let's consider the graph of our function (as far as we can; of course, it's impossible to actually draw the graph of $f$ but we'll use our imaginations) and try to get some intuition as to what the required $\epsilon$ should be. The graph of your function resembles the graphs of the lines $y=\pm x$; or, if you will, an X shape. For rational values of $x$, the point $\bigl(x,f(x)\bigr)$ is on the graph of $y=x$; and for irrational values of $x$, the point $\bigl(x,f(x)\bigr)$ is on the graph of $y=-x$.

I suggest you draw the picture now (when I have time, I'll provide one though).

Now if you take any open interval $I$ containing $x_0$, you can find both a rational number and an irrational number in $I$. (Why? This is the gist of the whole argument, so it's worthwhile that you convince yourself that you can.) Thus, you can find a point $x_1$ in $I$ that is irrational if $x_0$ is rational and which is rational if $x_0$ is irrational. It will follow then that $f(x_0)$ and $f(x_1)$ are far apart. In fact, they are approximately $2|x_0|$ away from each other when $I$ has small length, since, if you'll allow a sloppy and vague statement, $f(x_0)$ and $f(x_1)$ are on different arms of the X.

This leads us to suspect that $|x_0|$ would serve for the $\epsilon$ needed in statement S. And now it's a matter to formalize things. We need to show that statement S holds.

Let $0 < \epsilon < |x_0|$.

Let $\delta>0$ be arbitrary.

We need to show that there is an $x_1$ with $|x_0-x_1|<\delta$ such that $|f(x_0)-f(x_1)|\ge\epsilon $.

The preceding discussion points to a way towards finding $x_1$. Choose $x_1$ to be an irrational number with $|x_0-x_1|<\delta$ if $x_0$ is rational. If $x_0$ is irrational, choose $x_1$ to be an rational number with $|x_0-x_1|<\delta$.

Now we show this choice of $x_1$ "works":

Either

$\ \ \ \ \ f(x_0)=x_0$ and $f(x_1)=-x_1$

or

$\ \ \ \ \ f(x_0)=-x_0$ and $f(x_1)= x_1$.

In either case $|f(x_0)-f(x_1)| = |x_0|+|x_1|\ge |x_0|>\epsilon. $

And that's it...

Solution 2:

Let $x>0$, and assume that we can find a $\delta>0$ such that if $|y-x|\leq\delta$ then $|f(x)-f(y)|<x/2$. If $x$ is rational, it means $|x-f(y)|<x/2$ so $x/2<f(y)<3x/2$ for all $y\in (x-\delta,x+\delta)$. In particular, $y\in\mathbb Q$ for all $y\in (x-\delta,x+\delta)$. If $x$ i irrational, then $|x+f(y)|<x+2$ so $x/2<-f(y)<3x+2$ and $y$ has to be irrational if it is in $(x-\delta,x+\delta)$.

Do you see why it leads to a contradiction?