Homework Help: If f:R->R is continuous on a dense set of points in R, then f is continuous on R.

1. Apr 3, 2012

mrchris

1. The problem statement, all variables and given/known data
T or F, If f:ℝ→ℝ is continuous on a dense set of points in ℝ, then f is continuous on ℝ.

2. Relevant equations
definition of continuity using sequences, maybe?

3. The attempt at a solution
false. Take f(x)= {1 if x$\in$ Q(rational numbers) and 0 if x$\in$ (ℝ-Q)(irrational numbers)}. Then take some point x0$\in$ℝ. there exists a sequence {xn}of numbers in Q that converge to x0. then take the limit as n→∞ of f({xn}) which equals 1. Since this limit equals f(x0), f(x) is continuous for all x$\in$Q. however, we know that due to the density of rationals and irrationals, there also exists a sequence {in} of numbers in (ℝ-Q) that also converges to x0. If we then take the limit as n→∞ of f({in}), we see it equals 0. since this does not equal 1, f(x) is not continuous on ℝ
1. The problem statement, all variables and given/known data

2. Relevant equations

3. The attempt at a solution

2. Apr 3, 2012

HallsofIvy

You have shown that your function (the Dirichlet function) is NOT continuous on the set of all real numbers. What about on the rational numbers?

3. Apr 3, 2012

mrchris

I thought from the question that all I had to do was show that the function is continuous on a set of dense points (Q) but not continuous for all ℝ. did I somehow not do that? I'm not trying to be a smart-a but I am new to proofs like this.

4. Apr 3, 2012

Bacle2

Try working with 1/(x-a) , for some choice of a.

5. Apr 3, 2012

mrchris

i'm still not sure what I havent done correctly. i'm not doubting you guys, but I thought that I had shown that even though f(x) is continuous on the rationals, a dense set of points in R, f(x) is not continuous for all R. Can someone please explain what is wrong with my answer instead of suggesting new answers?

6. Apr 3, 2012

Bacle2

Sorry. Yes, your OP is on the right track. You have a continuous function on Q, but not so
on R, it is a valid counterexample.

7. Apr 3, 2012

jgens

Except that it's not. The Dirichlet function is discontinuous everywhere. You show that $f|_{\mathbb{Q}}$ is continuous on $\mathbb{Q}$ and that $f$ is discontinuous on $\mathbb{R} \setminus \mathbb{Q}$ (and as I said, it is actually discontinuous everywhere). This does not mean that $f$ is continuous on $\mathbb{Q}$ and discontinuous on $\mathbb{R} \setminus \mathbb{Q}$ as I have already noted.

8. Apr 3, 2012

Bacle2

I interpreted the OP to refer to the restriction of the function to Q; the restriction of the characteristic function to Q is the constant function 1, which is continuous.

There may be a technical issue of defining the function on Q as a stand-alone space, so that f==1 is continuous, or in defining it in Q as a subspace of R, in which case it is not.

9. Apr 3, 2012

jgens

And I noted in my last post that he does in fact show $f|_{\mathbb{Q}}$ is continuous. But the problem almost surely wants him to find a function $f$ such that $f$ is continuous on a dense subset of $\mathbb{R}$ but discontinuous somewhere on $\mathbb{R}$. That is different that showing that $f|_{\mathbb{Q}}$ is continuous on a dense subset of $\mathbb{R}$ but that $f$ is discontinuous on $\mathbb{R}$. So the OP most certainly does not have a valid solution.

10. Apr 3, 2012

Bacle2

Well, if the OP wanted the case you described, he is not done. Only he knows what he wants.

At any rate , a way of approaching the issue is: like the OP said, continuity implies sequential continuity, so that we want (xn→x)→(f(xn)→f(x)).
Does continuity on a dense subset allow to conclude this will happen ? (hint: do continuous functions always take Cauchy sequences to Cauchy sequences?)

11. Apr 3, 2012

mrchris

so could you possibly give me a suggestion to point me in the right direction?

12. Apr 3, 2012

Bacle2

Sure; if you can have a function f send Cauchy sequences to Cauchy sequences, (using the fact that ℝ is complete) , then the Cauchy sequence xn, with xn→x
will be sent to the Cauchy sequence f(xn) , which will then converge to f(x), giving you continuity.

Problem is that continuity of f alone is not strong-enough to guarantee this preservation of Cauchy sequences. An example is that of f(x)= 1/(x-a) , for certain choices of a. This f is continuous on Q (given the right choice of a) , but Cauchy sequences near 'a' will not map to Cauchy sequences.

Does that help?

13. Apr 3, 2012

mrchris

maybe i am thinking too simply here, but how about something like f(x)= 1/(x-$\sqrt{2}$). this function would be continuous on Q, but discontinuous at x=$\sqrt{2}$, therefore discontinuous on (ℝ-Q)?

14. Apr 3, 2012

Bacle2

No, perfect, that is what I was implying. Note that by adding a few of these, you can have discontinuities where you choose.
Now, a followup you may want to consider: what added condition on f would guarantee that Cauchy seqs. are sent to Cauchy seqs.? If you prefer, I'll just tell you and you can prove it works.

15. Apr 3, 2012

mrchris

that would be great i am cramming for a big test tomorrow morning

16. Apr 3, 2012

Bacle2

O.K: Uniform continuity does preserve Cauchy seqs. Good luck on the test.

17. Apr 3, 2012

mrchris

thanks for the help, this thread cleared that up nicely i think

18. Apr 3, 2012

Bacle2

Good to hear that; no problem.

19. Apr 3, 2012

Dick

I don't think this thread has really gotten anywhere near the crucial example. There's a pretty well known function that is continuous for all irrational points in R and discontinous for all rational points.

20. Apr 3, 2012

Bacle2

Maybe not the crucial example, but I think the key issue --preservation of Cauchy sequences-- has been brought up, together with the result that uniformly-continuous functions preserve Cauchy seqs.

I guess you're referring to f(x)=1/q for x=p/q, and f(x)=0 otherwise.