# Thread: Proving a function is discontinuous

1. ## Proving a function is discontinuous

Let $\displaystyle f(x)=1$ if $\displaystyle x\in \mathbb{Q}$ and $\displaystyle f(x)=0$ if $\displaystyle x\notin \mathbb{Q}$. Show that $\displaystyle f$ is discontinuous for all $\displaystyle x\in \mathbb{R}$

I know that I should find a sequence $\displaystyle (x_{n})$ where $\displaystyle \lim_{n\to \infty}x_{n} = x$, where $\displaystyle x_{n}$ is rational for even $\displaystyle n$ and irrational for odd $\displaystyle n$ (or vice versa), but I do not know how to find such a sequence.

2. You just need to find one sequence in $\displaystyle \mathbb Q$ with limit in $\displaystyle \mathbb R - \mathbb Q$

For example

$\displaystyle x_1=1$
$\displaystyle x_2=1+\frac{1}{2}$
$\displaystyle x_3=1+\frac{1}{2+\frac{1}{2}}$

etc

This sequence is obviously made of rationals but its limit is $\displaystyle \sqrt{2}$

so

$\displaystyle \lim f(x_n)=\lim 1 = 1 \not = 0 = f( \lim x_n) = f(\sqrt{2})$

But any such sequence works! For example a sequence of rationals with $\displaystyle \pi$ as limit.

3. But that is for specific values of $\displaystyle x$, is there any way to have a generalized case? Because the general idea and hint that the book suggests is that when you have $\displaystyle x_{n}$ be rational for even $\displaystyle n$ and irrational for odd $\displaystyle n$, so that the sequence $\displaystyle f(x_{n})$ does not converge at all. Because to me, it seems that all you've shown is that the function is discontinuous for irrational $\displaystyle x$ (because I believe there is a lemma that states that any real number is the limit of a sequence of rational numbers).

Edit: Nevermind, if we have $\displaystyle x\in \mathbb{Q}$, then $\displaystyle \lim_{n\to \infty}(x + \frac{1}{\sqrt{2} + n}) = x$, but all the terms of the sequence $\displaystyle x_{n} = x + \frac{1}{\sqrt{2} + n}$ are irrational.

4. Given any $\displaystyle a\in \mathbb{R}$ there is a sequence of rationals $\displaystyle \left(q_n\right)\to a$.
There is a sequence of irrationals $\displaystyle \left(\gamma_n\right)\to a$.
Now define a new sequence $\displaystyle x_n = \left\{ {\begin{array}{rl} {q_n ,} & {\text{n is even}} \\ {\gamma _n ,} & {\text{n is odd}} \\ \end{array} } \right.$

5. Thanks. I know it's not the topic, but could you perhaps prove that? We never proved in my class that any real number is the limit of a sequence of rationals or irrationals.

Edit: D'oh, I guess the sequence I suggested in my previous post shows the irrational part of the proof, but how is the rational part proven?

6. Originally Posted by Pinkk
Thanks. I know it's not the topic, but could you perhaps prove that? We never proved in my class that any real number is the limit of a sequence of rationals or irrationals.
Theorem: Between any two numbers there is a rational number and an irrational number.
So between $\displaystyle a~\&~a+1$ there is a rational number $\displaystyle q_1$.
Between $\displaystyle a~\&~a+0.5$ there is a rational number $\displaystyle q_2$.
In general, between $\displaystyle a~\&~a+2^{-n+1}$ there is a rational number $\displaystyle q_n$.
Thus $\displaystyle \left(q_n\right)\to a$.

The same for the irrational case.

7. Ah okay, gotcha, that makes sense. Thanks again.

8. Originally Posted by Pinkk
Let $\displaystyle f(x)=1$ if $\displaystyle x\in \mathbb{Q}$ and $\displaystyle f(x)=0$ if $\displaystyle x\notin \mathbb{Q}$. Show that $\displaystyle f$ is discontinuous for all $\displaystyle x\in \mathbb{R}$

I know that I should find a sequence $\displaystyle (x_{n})$ where $\displaystyle \lim_{n\to \infty}x_{n} = x$, where $\displaystyle x_{n}$ is rational for even $\displaystyle n$ and irrational for odd $\displaystyle n$ (or vice versa), but I do not know how to find such a sequence.
I'm not sure this is what Plato did...it looks different...

Let $\displaystyle x\in\mathbb{R}$ since both $\displaystyle \mathbb{Q},\mathbb{R}-\mathbb{Q}$ are dense in $\displaystyle \mathbb{R}$ there exists sequences of points $\displaystyle \{q_n\},\{i_n\}$ which lie in both. Now, if we assume that $\displaystyle f$ is continuous at $\displaystyle x$ then $\displaystyle 1=\lim\text{ }f(q_n)=f(x)=\lim\text{ }f(i_n)=0$. Contradiction.

Alternatively, assume that $\displaystyle f$ is continuous at $\displaystyle x$ and WLOG assume that $\displaystyle f(x)=1$. Clearly then $\displaystyle 0\notin B_{\frac{1}{2}}(f(x))$ but by continuity we should be able to find some $\displaystyle B_{\delta}(x)$ such that $\displaystyle f\left(B_{\delta}(x)\right)\subseteq B_{\varepsilon}(f(x))$. See a problem?