$f(x)=q$ if $x=p/q$, properly reduced is unbounded at every point. Define the function $f$ as follows: 
$$f(x) =
\begin{cases}
q,  & \text{if $x=p/q$,properly reduced} \\
0, & \text{if $x$ is irrational}
\end{cases}$$
Prove that for every real number $x_0$, $f$ fails to be bounded at $x_0$, i.e. there does not exist any neighborhood of $x_0$ for which $f$ is bounded at. 
It's enough to consider only rational points. Given any $x_0 \in \mathbb Q$, and any $\delta$-neighborhood of $x_0={p\over q}$ contains infinitely many rational points. So given any $M \gt 0$, in fact, greater than $q$, there can be only finitely many rationals in the $\delta$-neighborhood of $x_0$ with denominator less than or equal to $M$. Thus, there must be a rational in a properly reduced form with denominator greater than $M$ in the specified $\delta$-neighborhood of $x_0$, and so the value of the function at this point would be greater than $M$. Hence, $f$ is unbounded at any neighborhood of $x_0$. 
This is my solution and I think it's correct but I'm unsure how to rigorously show the bolded part. That is, how can I write it down to guarantee that there are only finitely many rationals satisfying the assertion? I'd appreciate a formal explanation on this part.

"It's enough to consider only rational points." << If you want to be rigorous, you may start by developing that (it's true but useless nonetheless).
Then, in general if you doubt your own argument's rigour, I'd suggest to go "$\epsilon, \delta$" and go back to axioms/statements you're 100% sure about.
Here's a draft example: 
Let $x \in \mathbb R$ and $\delta > 0$. We will show that $\forall M \in \mathbb N$, there exists $r \in \mathbb Q$ st $|x-r|<\delta$ and $f(r) > M$.
So let $M \in \mathbb N$. The set $A$ of rationals $r=p/q$ st $r \not=x$, $|x-r|<\delta$ and $q \le M$ is finite (because $|p| = |r|q \le |r|M \le (|x|+\delta)M$ and $q \le M$). (It is non empty because of $\mathbb Q$'s density).
So there is an element $r_0 \in A$ which is $\not= x$ and closer to $x$ than all others (if in doubt, see that the function $r \in A \mapsto |x-r|$ reaches its minimum, which has to be $>0$). 
Now there is at least a rational $r' =p'/q'\in \;]x,r_0[$ (again, density). Given that $r'\not= x$, $|x-r'| < \delta$ and $r' \not\in A$, by definition of $A$ we have $q' > M$, hence $f(r') > M$. QED
