# Function Continuous on Rationals but not on Rationals

Printable View

• May 27th 2009, 08:03 AM
h2osprey
Function Continuous on Rationals but not on Rationals
So we all know of a function that's continuous on the irrationals but discontinuous on the rationals, but what about this:

Are there functions $f : [0, 1] \rightarrow \mathbb{R}$
continuous on $\mathbb{Q}$ and discontinuous on $\mathbb{R} \backslash \mathbb{Q}$? Justify.

I'm quite sure the answer's no, but not entirely sure on how to prove it.

Any help would be much appreciated, thanks!
• May 27th 2009, 08:24 AM
Sampras
Quote:

Originally Posted by h2osprey
So we all know of a function that's continuous on the irrationals but discontinuous on the rationals, but what about this:

Are there functions $f : [0, 1] \rightarrow \mathbb{R}$
continuous on $\mathbb{Q}$ and discontinuous on $\mathbb{R} \backslash \mathbb{Q}$? Justify.

I'm quite sure the answer's no, but not entirely sure on how to prove it.

Any help would be much appreciated, thanks!

Consider $f: [0,1] \to \mathbb{R}$ defined by $f(x) = \begin{cases} 0 \ \ \text{if} \ x \ \text{is irrational} \\ \frac{1}{n} \ \ \text{if} \ x \in \mathbb{Q} \ \text{and} \ x = \frac{m}{n} \ \text{in lowest terms} \end{cases}$

This is continuous on the irrationals and discontinuous on the rationals. You can find a sequence $(a_n)$ such that $a_n \to x$ but $f(a_n) \not \to f(x)$ where $x \in \mathbb{Q}$.
• May 27th 2009, 11:07 AM
putnam120
The answer is no.

There is a theorem that states the points where a function f is continuous is a $G_{\delta}$ set.
A $G_{\delta}$ set, is a set that is the countable intersection of open sets. So the irrations can be written as $\bigcap Q_n$, where $Q_n=\mathbb{R}\backslash q_n$, with $\{q_n\}$ being an enumeration of the rationals.

I'll leave it to you to show that $\mathbb{Q}$ isn't a $G_{\delta}$ set.
• May 27th 2009, 11:08 AM
putnam120
Quote:

Originally Posted by Sampras
Consider $f: [0,1] \to \mathbb{R}$ defined by $f(x) = \begin{cases} 0 \ \ \text{if} \ x \ \text{is irrational} \\ \frac{1}{n} \ \ \text{if} \ x \in \mathbb{Q} \ \text{and} \ x = \frac{m}{n} \ \text{in lowest terms} \end{cases}$

This is continuous on the irrationals and discontinuous on the rationals. You can find a sequence $(a_n)$ such that $a_n \to x$ but $f(a_n) \not \to f(x)$ where $x \in \mathbb{Q}$.

Also the function in this example is continuous at x=0, which is a rational so it doesn't satisfy the necessary condition.
• May 27th 2009, 12:00 PM
Sampras
Quote:

Originally Posted by putnam120
Also the function in this example is continuous at x=0, which is a rational so it doesn't satisfy the necessary condition.

Let $a_n = \frac{\sqrt{2}}{n}$. Then $a_n \to 0$. And $f(a_n) \to 0$. But $f(0) \neq 0$. Because $0 = \frac{0}{1} = \frac{0}{2} = \cdots = \frac{0}{n}$ for $n \neq 0$.

And if you fix $t \in \mathbb{R}$ and $n \in \mathbb{N}$ you can show that $f$ maps finitely many elements of $\left(t- \frac{1}{2}, t+ \frac{1}{2} \right)$ to $\frac{1}{n}$. And we can use this to prove that $f$ is continuous at every irrational number.
• May 27th 2009, 12:23 PM
putnam120
(Blush) Oops, thanks for the clarification. However, I still stand by the fact that the function isn't what he is asking about. What he wants a function that is continuous on $\mathbb{Q}$ and discontinuous everywhere else. (The example you gave is not continuous at the $x=0$ so right there it fails)
• May 27th 2009, 12:25 PM
Sampras
But $0$ is rational! And he edited his question. Before it was the other way around.
• May 27th 2009, 01:04 PM
putnam120
Ah sorry, didn't know that he had changed the question.
• May 27th 2009, 01:05 PM
h2osprey
Quote:

Originally Posted by Sampras
But $0$ is rational! And he edited his question. Before it was the other way around.

Actually, I edited it to change the Latex which was showing an error, otherwise it's unchanged. I do know about the function continuous on irrationals but discontinuous on rationals - and the title's a typo sorry.

Thanks anyway!
• May 28th 2009, 08:29 AM
Showcase_22
Quote:

I'll leave it to you to show that isn't a set.
Can you show me how to do this? I haven't encountered these before and I would like to see what they're like!
• May 28th 2009, 08:33 AM
h2osprey
Quote:

Originally Posted by Showcase_22
Can you show me how to do this? I haven't encountered these before and I would like to see what they're like!

Once you've shown that the irrationals are a G-delta set, you can prove by contradiction.

Assume the the rationals are a G-delta set (say an intersection of countably many $A_n$. Since the rationals are dense in the reals, each $A_n$ is dense in the reals. Applying the same argument to the irrationals, we get that the intersection of the rationals and the irrationals (which is $\emptyset$) is a countable intersection of open dense sets. This violates the Baire category theorem, which states that any such intersection is non-empty (since the reals are complete).

And this completes the proof!
• May 28th 2009, 08:48 AM
Showcase_22
Quote:

Once you've shown that the irrationals are a G-delta set, you can prove by contradiction.
How do you do that part?

(sorry but i'm a first year maths student and i've only encountered these 5 mins ago when I read this post! However, they sound really interesting. Plus, I tihnk I may be able to use them to help me with some continuity proofs that i'm not super happy with).
• May 28th 2009, 08:49 AM
h2osprey
putnam120 mentioned it earlier:

Quote:

Originally Posted by putnam120
The answer is no.

There is a theorem that states the points where a function f is continuous is a $G_{\delta}$ set.
A $G_{\delta}$ set, is a set that is the countable intersection of open sets. So the irrations can be written as $\bigcap Q_n$, where $Q_n=\mathbb{R}\backslash q_n$, with $\{q_n\}$ being an enumeration of the rationals.

I'll leave it to you to show that $\mathbb{Q}$ isn't a $G_{\delta}$ set.

Hope this helps!