Given that $f(x) = -1$ if $f$ is irrational and $f(x)=1$ if $f$ is rational, show that $f$ is not continuous anywhere. 
Given that $f(x) = -1$ if $f$ is irrational and $f(x)=1$ if $f$ is rational, show that $f$ is not continuous anywhere.



*

*Let's show that between any 2 rationals there is always an irrational number


Let's consider $a,b \in Q$ such that $a<b$, there is an infinite number of rational $r$ such that $a<r<b$. Where $r=\frac{a+b}{n}$ where $n \in Z$
Also $$a<r<b$$, $$ a +\sqrt{2}<r<b+\sqrt{2}$$ , $$a<r- \sqrt{2}<b$$
It follows that we have always an irrational between any two rationals


*Between any two irrationals, we always have a rational.


Here I am not sure how to proceed.


*One can find a rational in between two irrationals and vice versa an irrational between two rationals.


Therefore as the value of $x$ approaches a value from the left or right of $r$ , $x$ will oscillates between a rational and irrational infinitely. Therefore limits will oscillate between $1$ and $-1$ infinitely. 
it shows that $$f(r^-) \neq f(r^+) \neq f(r)$$
it follows that there no continuity anywhere on $D_f$
Is this correct? Is there a more efficient (clean) way to show the discontinuity?
Any input is much appreciated
 A: Pick a real number $x$.  We will show that $f$ is discontinuous at $x$.  
Side Remark: Discontinuity of $f$ at $x$ can be shown by exhibiting at least once sequence $y_{n}$ that converges to $x$, yet violates the requirement
$$
\lim_{n \rightarrow \infty} f(y_{n}) = f(\; \lim_{n \rightarrow \infty} y_{n} \;).
$$
(Essentially, $f$ is continuous at $x$ if and only if $f$ commutes with the limit operation of convergence to $x$.)
Now, the proof:
Case 1: $x$ is rational.
Then there exists a sequence $y_{n}$ of irrational numbers that converges to $x$.  Thus,
$$
\lim_{n \rightarrow \infty} f(y_{n}) = -1 \neq 1 = f(\; \lim_{n \rightarrow \infty} y_{n} \;).
$$
Case 2: $x$ is irrational.
Then there exists a sequence $y_{n}$ of rational numbers that converges to $x$.  By an argument analogous to that in Case 1,
$$
\lim_{n \rightarrow \infty} f(y_{n}) \neq f(\; \lim_{n \rightarrow \infty} y_{n} \;).
$$
A: Take a rational $x $ and the   irrational sequence $x_n=x+\frac {\pi}{n}$ such that
$$\lim_{\infty}x_n=x$$
then
$$\lim_{\infty}f (x_n)=-1\ne f (x) $$
hence, $f $ is not continuous at $x $.
Take an irrational $y $ and the rational sequence $y_n=\frac {\lfloor 10^ny \rfloor}{10^n} $ such that
$$\lim_{\infty}y_n=y $$
then
$$\lim_{\infty}f (y_n)=1\ne f (y) .$$
You can conclude.
A: The key is exactly that between two real numbers there are a rational number and an irrational number.
Your final argument is a bit vague. You can make it rigorous by recalling that, when a function is continuous and positive at a point, it assumes only positive values in a neighborhood of the point. Let's state it more precisely.

Suppose $f$ is continuous at $c\in\mathbb{Q}$; then there exists $\delta>0$ such that, for $|x-c|<\delta$, $f(x)>0$.
There exists $x$ irrational such that $c-\delta<x<c+\delta$: contradiction.

Similarly for $c$ irrational.

More generally, the function
$$
g(x)=\begin{cases}
a & x\in\mathbb{Q} \\[4px]
b & x\in\mathbb{R}\setminus\mathbb{Q}
\end{cases}
$$
is nowhere continuous when $a\ne b$, because
$$
f(x)=\frac{2(g(x)-b)}{a-b}-1
$$
