Give example function $f: \mathbb{R} \rightarrow \mathbb{R}$ which $\forall x \in \mathbb{R}$ is not continuous function but is Borel function.
I think that I can take $$f(x) = \begin{cases} 1 & x \in \mathbb{R} \setminus \mathbb{Q} \ \\ -1 & x \in \mathbb{Q} \end{cases} $$
Am I right? How fast prove that it is Borel function?