Show $f$ is not continuous on $\mathbb{R}$ 
Show that the function $$f(x) \begin{cases} 1 & \text{if } x\in \mathbb{Q} \\ 0 & \text{if } x \not\in\mathbb{Q}\end{cases}$$ is not continuous anywhere in $\mathbb{R}$. Give reason(s) for your answer.

My Approach:
Between any two rational numbers, there exists infinitely many irrational numbers.
Also, between any two real numbers we know there exists a rational number. If we particularise this for two irrational numbers, we know that between any two irrational numbers, there exists a rational number.
Using the argument from above, we may deduce that the function $f$ results in an infinitely oscillating function between $0$ and $1$. Hence it cannot be continuous.
Does this reasoning make sense? Can anybody please provide me with a way to show this a bit more mathematically? Or provide me with a completely different approach?
 A: Pick a point $x \in \mathbb{R}$. Either $x$ is rational or irrational. Assume it is the latter, so $f(x) = 0$. Let $\epsilon = \frac{1}{2}$. Regardless of $\delta$, there will exist an irrational number $z$ such that $$|x - z| < \delta \ \ \text{but} \ \ |f(x) - f(z)| > \frac{1}{2}$$
where we have used the density of the reals and that $f(z) = 1$. So, this shows that $f$ is not continuous at $x$.
A similar approach works if $x$ is irrational. $\epsilon = \frac{1}{2}$ will work too.
A: Since $\mathbb{Q}$ is dense in $\mathbb{R}$, for every $x \in \mathbb{R}/\mathbb{Q}$ there exists a sequence $\{x_n\} \subset \mathbb{Q}$  of rational numbers such that $ x_n\rightarrow x$ and you have:
$$
\lim_{n \rightarrow \infty}f(x_n)= 1
$$
but $f(x)=0$
A: Your idea is fairly sound but you would get little or no credit on an exam for your answer.
If the $f(x)$ is continuous at some point $x=x_0$ then (by definition) for any given $\epsilon > 0$ you can find a $\delta > 0$ such that whenever $x-\delta < x < x+\delta$, $|f(x)-f(x_0) < \epsilon$.
In particular, at any irrational point $x_0$ (so that $f(x_0=0$suppose there exists such a $\delta$ that works for $\epsilon = \frac12$.  Then choose as a denominator any integer $d$ greater than $\frac{2}{\delta}$.  The interval $(x_0-\delta,x_0+\delta)$ contains at least one fraction with denominator $d$ therefore at that rational number $n/d$, $f(n/d) - f(x_0)  = 1 > \epsilon$.  Yet $n/d$ is in the $\delta$-neighborhood of $x_0$ for that $\delta$, so that $\delta$ cannot work in the definition.  Since no $\delta$ can work, the definition is not satisfied.
You need to complete the proof by assuming that $x_0$ is rational; here, using the theorem about irrational numbers lying between any two rationals might be an easy way to do this step.
