This question is from Spivak Chapter 5: Problem 20:
which says:
Prove that if $f(x) = x$ for rational $x$, and $f(x) = -x$ for irrational $x$, then $\lim_{x\to a}f(x)$ does not exist if $a \not= 0$.
My Work:
I want to base this on the previous problem which was:
Prove that if $f(x) = 0$ for irrational $x$ and $f(x) = 1$ for rational $x$, then $\lim_{x\to a}f(x)$ does not exist for any a.
Here: since the range of the values of $f(x)$ is 1, then I choose $\varepsilon$ to be $\frac{1}{4}$ and since near any a, there are both rational $x$ and irrational $x$, then for $0 < |x-a| < \delta$ if $|1 - l| < \frac{1}{4}$ then $|0 - l| > \frac{1}{4}$ and if $|0 - l| < \frac{1}{4}$ then $|1 - l| > \frac{1}{4}$ thus showing the limit does not exist.
However, for this problem, the range of the values of $f(x)$ is $2x$ yet I cannot choose $\varepsilon$ to be $\frac{x}{2}$ so it seems this same strategy would not work.
Thus how to choose $\varepsilon$ in this problem?
Thanks.