Show that this Variation of Thomae Function is Unbounded in any subinterval of [0,1], proof outline check. 
Let $f: [0,1] \to \mathbb{R}$ be defined as follows:
  $$ f(x) = \begin{cases}
0 & \text{for } x \in \mathbb{R}_+\setminus\mathbb{Q} \\\\
n & \text{for } x = \frac mn \in \mathbb{Q}_+ \text{ with } (m,n) = 1
\end{cases}$$

This is Thomae's function, and I'm asked to prove that it is unbounded in any subinterval of $[0,1]$.
Here is my plan to solve the problem:
Take any $(a,b) \subset [0,1] $. Let $x= \frac mp$ where p is a prime. Then $f(x) = p$. Because there are an infinite number of primes, $f$ is therefore unbounded on $(a,b)$
 A: You need to show that there are rational numbers with arbitrarily large denominators in (a,b). This is because the number of rational points in (a,b) is infinite, and the number of rational numbers with denominators less than any $n \in \mathbb{Z}^+$ in (a,b) is finite because it's finite in [0,1]. So by contradiction, there is a rational number in (a,b) with denominator greater than $n$. Call this rational number $x$. $f(x) > n$.
To see that there are an infinite number of rational numbers in (a,b) when $a \not = b$, just take the average of $a$ and $b$ and the average of that with $a$, and so on...
A: Let $0\leq a<b\leq 1.$ For $n\in \Bbb N$ let $S(n)=[0,1]\cap \{a/b: a,b\in \Bbb N\land b\leq n\}$ and let $T(n)=\{x\in \Bbb Q\cap [0,1]: f(x)\leq n\}.$ We have $T(n)\subset S(n).$
(I). If $a,a',b,b'\in \Bbb N$ with $b\leq n\geq b'$ and such that $a/b, a'/b'$ are unequal members of $S(n)$, then $0\neq |ab'-a'b|\neq 0,$ so $|ab'-ba'|\geq 1,$ so $|a/b-a'/b'|=|ab'-a'b|/|bb'|\geq 1/|bb'|\geq 1/n^2.$
(II). Given $n\in \Bbb N$ let  $n'=\max (n^2+1,\; 3( b-a)^{-1}+1).$ Let $m'=\min \{m\in \Bbb N: m'/n'\geq b\}.$ We have $m'\geq 3$ because $2/n'\leq 2(b-a)/3<b.$ 
We have $(m'-1)/n'< b\leq m'/n'$ and $1/n'<(b-a)/3$ so $a<(m'-2)/n'<(m'-1)/n'<b.$
But $|(m'-2)/n'-(m'-1)/n'|=1/n'<1/n^2.$ So by (I) it  is not possible for both $(m'-2)/n'$ and $(m'-1)/n'$ to belong to $S(n)$ so at least one of them does not belong to $T(n)$. 
So at least one $x\in \{(m'-2)/n' , (m'-1)/n'\}$ satisfies $(x\in (a,b) \land f(x)>n).$
I wanted to give a proof that doesn't mention primes.
