$\epsilon$-$\delta$ proof of discontinuity How can I prove that the function defined by
$$f(x) = \begin{cases} x^{2}, & \text{if $x \in \mathbb{Q}$;} \\ -x^{2}, & \text{if  $x \notin \mathbb{Q}$;} \end{cases} $$ is discontinuous? 
I see that it is true by using sequences but I cannot prove using only $\epsilon$'s and $\delta$'s.
 A: Just take $x=1$. For any $\delta>0$ you can find a non-rational number $y$ in $]1-\delta,1+\delta[$. Then clearly $|f(x)-f(y)|\geq 1$ by the definition of $f$. That means, for no $\epsilon<1$ you can find a $\delta$, such that $|f(x)-f(y)|\leq \epsilon<1$.
A: You should specify where it is continous and where it isn't, the function is continous in 0.
and for $x\neq 0$ take $\epsilon < x^2$ and try to find a $\delta$
A: The function $f$ is continuous at $0$. I claim that $f$ is discontinuous at any point $\xi\ne0$. 
Let a $\xi\ne0$ be given and put $\epsilon:=\xi^2>0$. Consider any $\delta>0$. The interval $\ ]\xi-\delta,\xi+\delta[\ $ contains some rational number $x'$ and some irrational number $x''$. In any case it contains a point $x$ with $|f(x)-f(\xi)|\geq \xi^2=\epsilon$. It follows that the chosen $\delta$ cannot testify continuity of $f$ at $\xi$ for this particular $\epsilon$, and as $\delta>0$ was arbitrary it follows that $f$ is not continuous at $\xi$.
A: Hint: Check if the sequence $f(1+\frac{\sqrt{2}}{n})$ becomes very close to $f(1)$ for large $n$
To do it using $\epsilon,\delta$ definition. Suppose there exists $\delta>0$ such that for $\forall y\in \mathbb{R}[|x-y|<\delta\implies|f(x)-f(y)|<0.1]$. Now choose $n$ sufficently large such that $|(1+\frac{\sqrt{2}}{n})-1|<\delta$ (Use the archemidean principle to do this). Thus $|f(1+\frac{\sqrt{2}}{n})-f(1)|<0.1$ Does this lead to a contradiction ?
A: Lets show that $f$ is discontinuous at $a>0$.
For each $\delta>0$ we can find $x_1,x_2\in (a-\delta,a+\delta), \ x_1\in\mathbb Q, \ x_2\not\in\mathbb Q$ such that $f(x_1)>\dfrac{a^2}{2}, \ f(x_2)<-\dfrac{a^2}{2}$. Therefore $\forall \delta>0 \ \exists x\in(a-\delta,a+\delta)$ such that $|f(x)-f(a)|>\dfrac{3a^2}{2}\Longrightarrow f$ is discontinuous at $a$.
