Show that the function is not continuous anywhere I'm trying to prove that a specific function $f$ is not continuous for any $x_0$ that it is defined for. Here's what I have so far.  Let
$$f(x) = \left\{
     \begin{array}{rl}
       -1 & \textrm{ if $x$ is irrational}\\
       1  & \textrm{ if $x$ is rational}
     \end{array}
   \right.$$
I claim that $f$ is not continuous anywhere. Suppose $a$ is an irrational number. By way of contradiction, suppose that $f$ is continuous at $a$. By definition, it follows that given $\epsilon >0$ there exists $\delta > 0 $ such that $|f(x)+1|<\epsilon$ if $0|x-a|<\delta.$ Then, we have that $$|f(x)+1| = |-1+1| = 0 < \epsilon$$ if $x$ is irrational and $$|f(x)+1|=|1+1|=2<\epsilon$$ if $x$ is rational. Thus, we have that $\delta > 0$ and $\delta > 2$.
$\textbf{Now this is where I am stuck}. $ Am I going about this the right way? Thanks!
 A: Hints:
You should know the facts that $\Bbb Q$ and $\Bbb R\setminus \Bbb Q$ is dense in $\Bbb R$ respectively.
Now suppose $x \in \Bbb R \setminus \Bbb Q$, then there exists a sequence $\{x_n: x_n\in \Bbb Q\}$ which converges $x$. Clearly, $f(x)=-1\not=1=\lim_{n\to \infty}f(x_n)$.
The other case is similar.
A: Hints:
In order to prove that $f(x)$ is not continuous at $a$, you only need to show that $\exists \varepsilon_0 > 0$, such that $\forall\delta>0$, there always exists $x_0$ with $|x_0-a|<\delta$, but $|f(x_0) - f(a)|\geq\varepsilon_0$. Here we can take $\varepsilon_0 = 1$, when $a$ is irrational, there always exists a rational number $x_0$ in the interval $(a-\delta,a+\delta)$ for any $\delta>0$, but $|f(x_0) - f(a)| = 2 > \varepsilon_0$. Similar when $a$ is rational. Hope this help.
A: I'd rather use the definition of $f$ not continuous at $a\in R$, which is the negation of definition of continuous.
$f$ is not continuous at $a\in R$ means exist $\epsilon>0$, such that for all $\delta>0$, we can find $x$ satisfies $|x-a|<\delta$ and $|f(x)-f(a)|\geq \epsilon$.
For your function take $\epsilon=2$, use the fact that every interval contains rational and irrational numbers.
