$f(x)=x$, if $x$ is rational and $f(x)= -x $ if $x$ is irrational. The function is defined on $[a,b]$. I have proved that the function is continuous in $0$ using the definition with $\epsilon$. But I want to proof when the function is not continuous, I think that maybe I could using sequence but I´m not sure.
 A: Sequential criterion for continuity: $f$ is continuous at $c$ if and only if for every sequence $\{x_n\} $converging to $c $,the sequence $\{f(x_n)\}$ converges to $f(c)$
Case 1:-
Let $c\in \mathbb {Q}$ and $x_n=c+\frac{\sqrt {2}}{n},n\in\mathbb{N}$
Then $ \lim \{x_n\}= c, f(c)=c ,\lim f(x_n)=-c\ne f(c)$
Thus the sequential criterion of continuity doesn't hold here thus $f$ is not continuous for all rational points.
Case:2
When$c\in \mathbb {R-Q-\{0\}}$
Take $y_n=\frac{[nc]+1}{n},n\in \mathbb {N}$
Where $[ p]$ denotes greatest integer function.
Then $c\lt y_n\lt c+\frac{1}{n}\implies \lim y_n=c ,f(c)=-c$
$\lim f(y_n)=c\ne f(c)$
Thus the sequential criterion of continuity doesn't hold here thus $f$ is not continuous for all irrational points.
A: Let $x_0\in\Bbb R\setminus\{0\}$. If $f$ was continuous at $x_0$, there would be a $\delta>0$ such that$$|x-x_0|<\delta\implies\bigl|f(x)-f(x_0)\bigr|<\bigl|f(x_0)\bigr|.$$But then, if $|x-x_0|<\delta$, $f(x)$ has the same sign as $f(x_0)$. This is impossible, because, near $x_0$, $f(x)>0$ if $x\in\Bbb Q$ and $f(x)<0$ is $x\notin\Bbb R\setminus\Bbb Q$, if $x_0>0$; if $x_0<0$, you must switch these inequalities.
A: Easiest approach:
Let $s$ be in $[a,b]$, $s\neq0$. We will shot that $f$ is not continously in $s$. 
Remember that if $f$ is continous in $s\in\text{Dom}_f$ and  $\{x_n\}_{n\in\mathbb{N}}$ converges to $s$, then $\lim_{n\to\infty}f(x_n)=f(\lim_{n\to\infty}x_n)=f(s)$
Since $\mathbb{Q}$ and $\mathbb{I}$ are dense over $\mathbb{R}$, there exits $\{q_n\}_{n\in\mathbb{N}}\subset\mathbb{Q}$ and $\{r_n\}_{n\in\mathbb{N}}\subset\mathbb{I}$ sucht that $q_n\to s$ and $r_n\to s$.
Since the limits $f(q_n)=q_n \to s$ and $f(r_n)=-r_n\to-s$ are distinct (except for $s=0$), the function is not continous
