Is this epsilon-delta proof correct? Consider the function $f:\mathbb{R}\rightarrow\mathbb{R}$ $$f(x)=\begin{cases}x,\ x\in\mathbb{Q} \\ -x,\ x \notin \mathbb{Q}.\end{cases}$$
I'm trying to prove that for all $a \neq 0$, $\lim_{x \to a}f(x)$ does not exist. I tried to do this by contradiction, so my first step was to suppose that $$\lim_{x \to a}f(x)=A,$$ for some $A \in \mathbb{R}$. Then this implies that $$\forall \varepsilon>0\ \exists\delta:\ 0<|x-a|<\delta\implies|f(x)-A| < \varepsilon.$$
So I said, consider some $p \in \mathbb{Q}:0<|p-a|<\delta$, and therefore $|f(p) - A|=|p-a|<\varepsilon_1$. Also consider a $q \in \mathbb{R}, q \notin \mathbb{Q}:0<|q-a|<\delta$, and therefore $|f(q)-A|=|-q-A|=|q+a|<\varepsilon_2$. Since the epsilon-delta definition allows us to choose whatever $\varepsilon$ we want, I chose to let $\varepsilon_1 = p$ and $\varepsilon_2 = q$.  This then implies the following $$|p-A|<\varepsilon_1=p \implies p-A<p \implies A>0,$$ $$|q+A|<\varepsilon_2=q \implies q+A<q \implies A<0.$$
Since we cannot have $A>0$ and $A < 0 $, this is a contradiction, and therefore the limit does not exist. $\square$
Does this proof seem correct? In particular I'm concerned that I never made use of the fact $a \neq 0$, so I was hoping someone could review it and let me know if there are any errors. This problem is from Spivak's Calculus, 4th ed., and the proof give in the solution book is quite different than mine, so I wasn't able to check my answer that way.
Thanks. 
EDIT:
Here's the corrected proof.
Assume for some $a > 0$ that $\lim_{x \to a} f(x) = A$, for some $A > 0$. Then from the epsilon-delta definition there is some delta such that $0 < |x-a| < \delta \implies |f(x) - A| < A$. Choose some irrational $q > 0$ such that $0 < |q - a| < \delta$, which implies that $|f(q) - A) = |-q - A| = |q + A| < A$, but this would mean that $q + A < A \implies q < 0$, a contradiction.
To prove that $f$ does not approach a negative limit either, let $\varepsilon = -A$, and pick some $p \in \mathbb{Q}$ such that $0 < |p - a| < \delta$, so therefore $|f(p) - A| = |p - A| < -A$. This implies that $p - A < -A \implies p < 0$, again a contradiction.
Finally, to prove that $f$ does not approach a $0$ limit, let $\varepsilon = a$, and then pick some $y > a$ such that $0 < |y-a| < \delta$. This would imply that $|f(y)| = y < a$, which is again a contradiction, so $f$ does not approach a limit for $a > 0$, and therefore $a < 0$. $\square$
 A: I'm afraid not. You're supposed to be able to fix some distance $\epsilon>0,$ at which point you can find some distance $\delta>0$ such that $f(x)$ is within $\epsilon$ of $A$ so long as $x\ne a$ is within $\delta$ of $a$. We can of course use that $\delta$ (as you seem to be doing) to come up with a smaller $\epsilon'$, but then we'd in turn find a (probably) smaller $\delta'$ that worked. This is where your argument fails.
To reach a contradiction, then, you'll need to choose your $\epsilon>0$ with some care, depending on what $a$ is. I recommend that you sketch a graph of the function, using dotted lines to give yourself the idea. It should make clear how tight we need to make the vertical window around $A$ so that we can always find $x$ arbitrarily close to $a$ for which $f(x)$ is not in that vertical window. (The fact that $a\ne 0$ will be essential to being able to find such a window.)
A: Here is a 'constructive' proof:
Since $f(-x) = -f(x)$, we may assume that $a>0$.
Choose $x \in \mathbb{Q}$ such that $x \ge a$ and $x' \in \mathbb{Q}^c$ such that $x' \ge a$. Then $f(x)-f(x') = x+x' \ge 2 a$.
Choose $A\in \mathbb{R}$, then $(f(x)-A)+(A-f(x'))  \ge 2 a$, and hence $\max(f(x)-A, A-f(x')) \ge a$ (otherwise an immediate contradiction).
Let $\delta>0$, then we can choose the $x,x'$ above so that $|x-a|< \delta$ and $|x'-a|< \delta$. Then either $|f(x)-A| \ge a$ or $|f(x')-A| \ge a$. Hence the limit does not exist.
