# 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!

• Just let $x \in \mathbb{R}$. Then choose a sequence $x_n \in \mathbb{Q}$ such that $x_n \to x$ and another sequence $y_n \notin \mathbb{Q}$ such that $y_n \to x$ – Mustafa Said Oct 21 '14 at 1:11
• When you wrote |f(x)+1|=2 if $x$ rational you already proved discontinuity, due to density of rationals. – Milly Oct 21 '14 at 1:11
• @Milly, I know a bit about density, but could you explain how $|f(x)+1|=2$ proves discontinuity. Thanks! – Pubbie Oct 21 '14 at 1:12
• Since for any irrational $a$ and $\delta>0$ you can find a rational in $(a-\delta,a+\delta)$, given $\epsilon<2$, no $\delta$ can work since you get $|f(x)-f(a)|=2>\epsilon$ for any $x$ rational. – Milly Oct 21 '14 at 1:15

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.

• Thank you for your hint. Unfortunately, I can't go about it this way since my class has not touched on convergence yet. Still, i'll give you an upvote the helpful hint! – Pubbie Oct 21 '14 at 1:13

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.

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.

• Ah, I see. Thanks! – Pubbie Oct 21 '14 at 1:20