Are Monotone functions Borel Measurable?

Could you guide me how to prove that any monotone function from $R\rightarrow R$ is Borel measurable?
Should we separate the functions into continuous and non-continuous? How to prove for not continuous points?

Thanks for your help

Solutions Collecting From Web of "Are Monotone functions Borel Measurable?"

Hint: If $f$ is monotone, then, for every real number $x$, the set $f^{-1}((-\infty,x])=\{t\mid f(t)\leqslant x\}$ is either $\varnothing$ or $(-\infty,+\infty)$ or $(-\infty,z)$ or $(-\infty,z]$ or $(z,+\infty)$ or $[z,+\infty)$ for some real number $z$.

To show this, assume for example that $f$ is nondecreasing and that $u$ is in $f^{-1}((-\infty,x])$, then show that, for every $v\leqslant u$, $v$ is also in $f^{-1}((-\infty,x])$.