Determine the sets on which $f$ is continuous and discontinuous. 
Let $f:\mathbb R\to\mathbb R$ be defined by $$f(x):=\begin{cases} x, &\text{if } x\in\mathbb Q\;;\\ -x, &\text{if } x\in\mathbb R\setminus\mathbb Q.\end{cases}$$
Determine the sets on which $f$ is continuous and discontinuous. Prove your answer.

I know that I should use sequential criterion for continuity to prove this, but I don't even know in which set will $f$ be continuous or discontinuous. Please give me some ideas.
Thank you.
 A: As usual, I'm going to suggest that you draw a picture. It's impossible in this case to actually draw a precise graph of the function, but you can definitely draw the general gist of what it looks like if you squint. That should help you get an intuitive grasp of where it should be continuous and where it should not be, after which you can prove it by various means (I personally would go for a plain old $\epsilon$-$\delta$ approach, but you can use sequences if you like).
A: You pointed out that you can use sequences to characterize the continuity.
Therefore $f$ is continuous at $x$ if and only if we can approach it using both positive and negative numbers. It is not hard to show that if $x>0$ then this is impossible, and similarly if $x<0$. What else remains?
I'll leave the rest of the work to you.
A: By the equality $|f(x)|=|x|$ we can see that $f$ is continuous at $0$.
Now for $x\neq 0$, if $x\in\mathbb Q$ there's a sequence $(x_n)$ of irrational numbers such that $x_n\to x$ and if $f$ is continuous at $x$ we have $f(x_n)=-x_n\to-x=f(x)=x$ which is a contradiction. The same method if $x\in \mathbb R\setminus \mathbb Q$.
