suppose $x_n = \frac{p_n}{q_n} \in Q_n$ where $\frac{p_n}{q_n}$ is in reduced form and $x_n \to a, a \notin \mathbb{Q}$ prove $q_n \to \infty$ suppose $x_n = \frac{p_n}{q_n} \in Q_n$  where $\frac{p_n}{q_n}$ is in reduced form and $x_n \to a, a \notin  \mathbb{Q}$. Prove $q_n \to \infty$ and use the result to deduce the Thomae function is continuous at every irrational point. 
$\mathbb{Q}$ is not closed and not open and neither is the set of irrational numbers. And under the assumptions given there's nothing to really prove that the Thomae function is discontinuous at rational points. 
$$ \left|\frac{p_n}{q_n} - a \right| = \left| \frac{p_n - a \cdot q_n}{q_n} \right| < \epsilon, \forall \epsilon > 0 $$
I'm not sure what I can use to show $q_n \to \infty$
 A: For all $k \in \mathbb{N}$ define $F_k = {1 \over k} \mathbb{Z} = \{\cdots, -{1 \over q}, {0 \over q}, {1 \over q}, \cdots \}$. Note that $d_k=\min_{r \in F_k} |a-r| >0$ for all $n$ (otherwise $a$ must be rational).
Suppose an infinite number of the $|q_n|$ satisfy $|q_n| \le N$ for some $N$. This means that $x_n \in F_1 \cup F_2 \cup \cdots \cup F_N$ for all such $n$.
We have $\delta = \min_{k \in \{1,...,N\}} d_k > 0$, and so $|x_n-a| \ge \delta$ for all such $n$, which contradicts $x_n \to a$. In particular, for any $N$, there are only a finite number of $q_n$ that satisfy $|q_n| \le N$. In particular, $|q_n| \to \infty$.
By adjusting the sign of $p_n$ we can assume that $q_n > 0$.
Proof of continuity of $f$ follows from this:
You have $f(a) = 0$. One way to show continuity is to show that for all sequences $y_n \to a$, we have $f(y_n) \to 0$.
Suppose
$y_n \to a$. If $y_n$ is irrational, we have $f(y_n) = 0$. If there are only
a finite number of rational $y_n$ then we see that $f(y_n) \to 0$.
Suppose there are an infinite number of rational $y_n$ and
let $y_{n_k}$ be the subsequence of rationals.
and $y_{n_k} = {p_{n_k} \over q_{n_k}}$ with $p_{n_k},q_{n_k}$ coprime, then we must have $q_{n_k} \to \infty$, and so $f(y_{n_k})={1 \over q_{n_k}} \to 0$.
Combining these results we have $f(y_n) \to 0$.
A: Here is an alternative solution to the OP based in continued fractions. These types of fractions yield the best rational approximations to numbers. First, a few general facts about  continued fractions:
For simplicity, I only focus on numbers in the interval $[0,1]$.  Define $$T(x)=\left\{\begin{array}{lcr}
\mapsto\frac{1}{x}-\lfloor \frac1x\rfloor &\text{if} & x\neq0\\
0 &\text{if} & x=0
\end{array}\right.$$
where $\lfloor \cdot\rfloor$ is the floor function (a.k.a. maximum integer function).
Then, if $0<x<1$
$$x=\frac{1}{1/x}=\frac{1}{\lfloor \frac1x\rfloor + Tx}=\frac{1}{a_1 +Tx}$$
where $a_1(x)=\lfloor \frac1x\rfloor$. Continuing this way, and as long as $T^{n-1}x=T(T^{n-2}(x))\neq0$, let $a_n(x)=\lfloor \tfrac{1}{T^{n-1}x}\rfloor$. We obtain the sequences of rational numbers
$$ x_n:=\frac{1}{a_1+\tfrac{1}{a_2 +\ddots\tfrac{1}{a_{n-1}+\tfrac{1}{a_n}}}}$$
It turns out that the rational approximations $x_n$ in some sense that can be made very precise:

*

*If $x$ is rational, the sequence $x_n$ is final after a finite number of steps.

For irrational $x$, the sequence $x_n$ is infinite and


*$x_n=\frac{P_n}{Q_n}$ where
\begin{align}
P_n&=a_nP_{n-1}+P_{n-2}\tag{1}\label{one}\\
Q_n&=a_nQ_{n-1}+Q_{n-1}\tag{2}\label{two}
\end{align}
with $P_0=0$, $P_1=1$, $Q_0=1$ and $Q_1=a_1$.


*It is relatively easy to check that $g.c.d(P_n,Q_n)=1$ for all $n\geq0$, i.e. all fractions $P_n/Q_n$ are reduced.


*With a little more effort we have the bounded
\begin{align}
\frac{1}{Q_nQ_{n+2}}<\Big|x-\frac{P_n}{Q_n}\Big|<\frac{1}{Q_nQ_{n+1}}\tag{3}\label{three}
\end{align}

Solution to the OP:
That the rational $x_n$'s are the best rational approximations to $x$ is expressed in the following result

Theorem A: If there is a rational number $a/b$ with $b>0$ such that
\begin{align}\big|x-\frac{a}{b}\big|<\big|x-\frac{P_n}{Q_n}\big|\tag{4}\label{four}\end{align}
for some $n>0$, then $b>Q_n$.

If  $x$ is irrational, \eqref{one} and \eqref{two} imply that both $P_n(x), Q_n(x)$ are strictly monotone and thus, $P_n,Q_n\xrightarrow{n\rightarrow\infty}\infty$. By \eqref{three} $\frac{P_n}{Q_n}\xrightarrow{n\rightarrow\infty}x$. The conclusion of the OP follows from \eqref{four}.

Comment: It is customary to use the notation $[a_1a_1\ldots]$ for the number $x$; other notations are $\frac{1}{a_1+}\frac{1}{a_2+}\cdots$.
A: Here's a simple proof by contradiction. Suppose that $q_n$ does not approach infinity. Then there exists some $M\in\mathbb{N}$ and some subsequence $n_k$ such that $|q_{n_k}|\leq M$ for all $k$. But then
$$M!a=M!\lim_{k\to\infty} \frac{p_{n_k}}{q_{n_k}}=\lim_{k\to\infty} p_{n_k}\frac{M!}{q_{n_k}}$$
But this then implies the expression in the limit is integral for all $k$ since $q_{n_k}|M!$. Since a sequence of integers cannot approach the irrational number $M!a$ we have reached a contradiction.
