This is what I'm trying to prove:
Let $f:\mathbb{R}\rightarrow \mathbb{R}$ be represented by $$ f(x) = \begin{cases} 1/q & \text{if $x=p/q$ where $p,q \in \mathbb{Z}$, $q>0$, and $|p|$ and $q$ relatively prime} \\ 0 & \text{otherwise} \\ \end{cases} $$ $f(x)$ is discontinuous for rational numbers and continuous for irrational numbers.
This is the definition of continuous I am trying to use.
A function is said to be continuous at a point $x_0$ if all sequences $\{x_n\}$ which converge to $x_0$ cause the image sequence $\{f(x_n)\}$ to converge to $f(x_0)$. A function is continuous if it is continuous at every point in its domain.
Proof for Irrationals
Let $x_0$ be irrational.
Then $x_0$ cannot be represented as a ratio of integers, so $f(x_0)=0$.
By the sequential compactness of the rationals and irrationals, there exists a sequence of rational numbers $\{u_n\}$ and a sequence of irrational numbers $\{v_n\}$ which both converge to $x_0$.
Note, however, that for an infinite sum of irrational numbers to converge to an irrational number, $p_n$ and $q_n$ cannot converge, otherwise $x_0$ could be represented as a ratio. Therefore $$\lim _{n\rightarrow \infty} 1/q_n = 0$$
Therefore $$\{f(u_n)\}\rightarrow 0$$ And because $\{v_n\}$ is a sequence of irrational numbers, $$\{f(v_n)\}\rightarrow 0$$
Therefore $f$ is continuous at $x_0$.
Proof for Rationals
Suppose that $x_0$ is rational.
Then $x_0=p/q$ where $p,q \in \mathbb{Z}$, $q>0$, and $|p|$ and $q$ relatively prime.
By the sequential compactness of the rationals and irrationals, there exists a sequence of rational numbers $\{u_n\}$ and a sequence of irrational numbers $\{v_n\}$ which both converge to $x_0$.
Because $\{u_n\}$ is a sequence of rational numbers converging to a rational number, $$\{f(u_n)\}\rightarrow 1/q$$
Since $\{v_n\}$ is a sequence of irrational numbers converging to a rational number, $$\{f(u_n)\}\rightarrow 0$$
Therefore $f$ is discontinuous at $x_0$.