Define $f(x)$ for $x\in[0,1]$ by $f(\frac pq)=\frac1q$ if $p$ and $q$ are relatively prime, and $f(x)=0$ if $x$ is irrational.
How can we see that $f$ is discontinuous at all rational points and continuous at all irrational points?
Furthermore, if $g(\frac pq)=q$ for $(p,q)=1$ and zero otherwise, how can we see that $g$ is not bounded on any subinterval of $[0,1]$?