Prove the function $f:\mathbb{R}\rightarrow \mathbb{R} $ defined by $f(x)= \begin{cases} 1/p, &\text{if $x=p/q$ is rational}\\ 0, &\text{if x is irrational}\\ \end{cases}$ is Borel measurable.
I began trying to show {$f\geq a$} is a Borel set. So I considered different values for a to find the x's, and unioned all the possible x values, if that makes any sense. But then I got all of $\mathbb{R}$.
I have been doing this for a long time and I am now very confused.