I just wanted to ask, if this proof can be used when trying to prove that function $f\left( x \right)= x$, if $x$ is rational, and $f\left(x \right)=-x$, if $x$ is irrational. Then $\lim\limits_{x \to a}f\left(x \right)=l$ for any $l$ can't exists unless $a=0$. I am trying to prove this by using epsilon-delta definition of limit.
If we assume that such $l$ exists for some $a$. Then for every $\epsilon>0$, there is some $\delta>0$, then for all $x$, if $\left|x-a \right|< \delta$, then $\left|f\left(x \right)-l \right|< \epsilon$. For clarity, if $x$ is rational then $x=\alpha$, and $f\left( \alpha\right)=\alpha$, then if $x$ is irrational, then $x=\beta$ and $f\left( \beta\right)=-\beta$
Then we have $\left|\alpha-l \right|<\epsilon$ and $\left|\beta+l\right|<\epsilon$. Furthemore it can be written as $l-\epsilon<\alpha < l+\epsilon$ and $-\epsilon - l< \beta < \epsilon -l$. Then by adding these up $\left| \alpha + \beta\right|<\left| \alpha-l+\beta+l\right|\leq\left|\beta+l \right|+\left|\alpha-l \right|< 2\epsilon$, so $\left|\alpha+\beta \right|<2 \epsilon$, or ca be written as $\left|\alpha+\beta \right|< \epsilon$
Now then, if $\left| \alpha \right|>\epsilon$, then $\alpha \in \left(-\infty, -\epsilon \right) \cup \left(\epsilon, \infty \right)$, but too $\alpha \in \left( l-\epsilon, l+\epsilon \right)$, which contradicts itself, same for $\beta$. From this, only if both $\left| \alpha \right|<\epsilon$ and $\left| \beta \right|<\epsilon$ can this limit work.
Now then, we have, for for example $\alpha$, $a- \delta < \alpha < a+ \delta$, so $-\epsilon < a-\delta$, and $a + \delta < \epsilon$, then we must have $\epsilon > -a$, and $a < \epsilon$, but since $\epsilon$ can change and $0< \epsilon$, that for some $a$, $a>\epsilon$, so unless $a=0$, this inequality cannot work. so $a$ must be $0$. Same works for $\beta$.
Then as $l-\epsilon < \alpha < l+ \epsilon$, $\epsilon \leq \epsilon +l$ and $-\epsilon \geq l-\epsilon$. From this we find that $ 0 \leq l$ and $0\geq l$, so $ l=0$. Same for $\beta$.
So, the only limit for this function is $\lim\limits_{x \to 0} f\left( x\right)=0$, so if $a=0$.
Here is an easy way of solving it using equivalent condition of limits in terms of sequences.
Let us assume limit at $a$ exists and equal to $l$. Consider the sequence $p_n$ of rational numbers and $q_n$ of irrational numbers converging to $a$ where each $p_n$ and $q_n$ are different from $a$. Since limit exists $f(p_n) \to l$ and $f(q_n) \to l$ but $f(p_n) = p_n \to a$ and $f(q_n) = -q_n \to -a$. Hence we must have $l = a = - a$ by uniqueness of limits which implies that $l = a = 0$.