# Prove that there doesn't exist any function $f:\mathbb R\to \mathbb R$ that is continuous only at the rational points.

Prove that there doesn't exist any function $$f:\mathbb R \to \mathbb R$$ that is continuous only at the rational points. Suggestion: For every $$n \in \mathbb N$$, consider the set $$U_n=\{x \in \mathbb R : \exists U \subset \mathbb R \,\text{open, with}\, x \in U, {\rm diam}(f(U))<1/n\}.$$

I am supposed to prove this statement using the Baire Category theorem. I am not sure but I think that the suggestion points towards trying to express $$\mathbb R$$ as the union of the sets $$U_n$$. If I could prove that any $$U_n$$ is a nowhere dense set and I affirm $$\mathbb R=\bigcup_{n \in \mathbb N} U_n$$, since the Baire Category theorem says that the interior of a countable union of nowhere dense sets is empty, I would get to an absurd. I have two problems: what does this have to do with the fact that there can't be any function $$f$$ continuous only at rational points? How can I assure that every $$x \in \mathbb R$$ is in some $$U_n$$? Moreover, is there any non-empty $$U_n$$?

• I think this may work, or at least may be on the right track: you can show that the points of continuity are those that are in $U_n$ for all positive integers $n$. This is a $G_{\delta}$ set, as the intersection of the open sets $U_n$. This means the complement is an $F_{\sigma}$ , which relates to Baire category. Commented Nov 15, 2013 at 3:50
• It works pretty well, thanks! Commented Nov 15, 2013 at 4:09

You've got it backwards. It's not $U_n$ that will be nowhere dense, but its complement.

1. Show that $\bigcap_n U_n$ is precisely the set of points at which $f$ is continuous.

2. Show that $U_n$ is open.

3. Suppose $f$ is continuous at the rationals. Show $U_n$ is also dense. Hence, $U_n^c$ is closed and nowhere dense.

4. Using the previous statement and the fact that the rationals are countable, write $\mathbb{R}$ as a countable union of nowhere dense sets, contradicting the Baire category theorem.

Taking complements can be used to restate the Baire category theorem in the following equivalent way: a countable intersection of dense open subsets of $\mathbb{R}$ is dense.

• Your answer was extremely helpful, I was really mixed up and I didn't know how to use the suggestion properly. Commented Nov 15, 2013 at 4:07

Let $$f:\Bbb R\to \Bbb R$$ and let $$D$$ be the set of $$x\in \Bbb R$$ such that $$f$$ is discontinuous at $$x$$.

For $$q\in \Bbb Q^+$$ let $$x\in D(q)$$ iff $$\sup \{|f(y)-f(z)|:y,z\in U\}>q$$ whenever U is open and $$x\in U.$$

Every $$D(q)$$ is closed. For if $$x'\in \overline {D(q)}$$ and $$U$$ is any open set with $$x'\in U$$ then there exists $$x\in U\cap D(q).$$ Now, since $$x\in D(q)$$ and $$U$$ is open with $$x\in U,$$ we have $$\sup \{|f(y)-f(z)|: y,z\in U\}>q.$$ So $$x'\in D(q).$$

We have $$D=\cup_{q\in \Bbb Q^+}D(q).$$ So $$D$$ is an $$F_{\sigma}$$ set. So $$C=\Bbb R \setminus D$$ is a $$G_{\delta}$$ set.

Suppose $$C$$ is also dense. Let $$C=\cap_{n\in \Bbb N}\,U_n$$ where each $$U_n$$ is open. Each $$U_n$$ is dense because $$\overline U_n\supset \overline C=\Bbb R.$$ Let $$S$$ be any countable set, with $$S\subseteq \{s_n:n\in \Bbb N\}.$$ Then each $$U_n\setminus \{s_n\}$$ is dense & open, so by Baire, $$C\setminus S\supseteq \cap_{n\in \Bbb N}(U_n \setminus \{s_n\})\ne \emptyset.$$ So $$C$$ is not equal to any countable $$S$$. In particular $$C\ne \Bbb Q.$$

Remarks: (1). Regardless of the Continuum Hypothesis, if $$C$$ is a dense $$G_{\delta}$$ subset of $$\Bbb R$$ then $$|C|=2^{\aleph_0}=|\Bbb R|$$. (2). If $$C$$ is any $$G_{\delta}$$ subset of $$\Bbb R$$ then there exists $$f:\Bbb R \to [0,1]$$ such that (i) $$f(x)=0\iff x\in C,$$ and (ii) $$f$$ is continuous at $$x \iff x\in C.$$

• I do not understand the general idea of your proof and why you wrote $D(q)$? Commented Mar 16, 2020 at 0:52
• @Emptymind . $D(q)$ is defined in the A. The idea is that each $D(q)$ is closed and that $\Bbb Q^+$ is countable so $D$ is $F_{\sigma}$, so the set of points where $f$ is continuous is a $G_{\delta}$ set ... But $\Bbb Q$ is NOT $G_{\delta}..$ Commented Mar 17, 2020 at 5:48