My problem is as follows-
Let $f : \mathbb R \to \mathbb R$ be defined in the following manner
$$f(x) = \begin{cases} x & \text{if $x$ is rational,} \\x^2 & \text{if $x$ is irrational.} \end{cases}$$
Prove that $f$ is discontinuous at all the real points except $0$ and $1$.
I tried it like this-
[$f$ is continuous at $a$] $= \forall \epsilon >0, \exists \delta >0, \forall x \in \mathbb R, \text{ s.t. }|f(x)-f(a)|< \epsilon, |x-a|< \delta$
~[f is continuous at a ] = ~[ $\forall \epsilon >0, \exists \delta >0, \forall x \in \mathbb R, s.t. |f(x)-f(a)|< \epsilon, |x-a|< \delta$]
f is discontinuous at a = $\exists \epsilon >0, \forall \delta >0, \exists x \in \mathbb R, s.t. |f(x)-f(a)|> \epsilon, |x-a|< \delta$
Case 1: a=0
f(a)=0 and |x-a|=|x|
$\therefore \exists \epsilon >0,\forall \delta >0, \exists x \in \mathbb R, s.t. |f(x)|> \epsilon, |x|< \delta $ is false.
$\therefore$ f is continuous at 0
Case 2: a=1
f(a)=1 and |x-a|=|x|-1
I don't know how to prove this and the following case.
Case 3: a $\neq$ 0 and a $\neq$ 1