Writing $\mathbb{R}$ as a countable union of nowhere dense sets.

baire-categoryfunctional-analysismetric-spacesproof-explanationreal-analysis

I am trying to answer this question:

Let $f$ be a real-valued function on a metric space $X.$ Show that the set of points at which $f$ is continuous is the intersection of a countable collection of open sets. Conclude that there is no real-valued function on $\mathbb{R}$ that is continuous at the rational numbers only.

Here is my answer for the first part:

For $n\in\mathbb{N}$, consider the sets
$$
U_n:=\{x\in X:\exists\delta>0,\forall y,z \in X, \, y,z\in B(x,\delta)\implies |f(y) – f(z)|<1/n\}.
$$

I managed to prove that those $U_{n}$ are open and that the set of continuities of $f$ is a $G_{\delta}$ set and that $U_{n}$ is dense. Now following the sequence of steps required to complete the solution of the problem regarding to the second part as suggested here

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

I have to do the following: for $f:\mathbb R\to \mathbb R$

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

  2. 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. \

My question is:

I know that $\mathbb{Q}$ is in $U_{n}$ (not in $U_n^c$ which are nowhere dense sets) how this can lead me to write $\mathbb{R}$ as a countable union of nowhere dense sets.

Best Answer

As explained in the answer you linked, the set of points at which $f$ is continuous (i.e. $\mathbb{Q}$) is the intersection of all the $U_n$. Thus: \begin{align*}\mathbb {Q}&=\bigcap_{n\in\mathbb{N}} U_n\\ \mathbb{R}-\mathbb{Q}&=\bigcup_{n\in\mathbb{N}} U_n^c\\ \mathbb{R}&=\bigcup_{n\in\mathbb{N}} U_n^c\bigcup_{q\in\mathbb{Q}}\{q\}\end{align*}

Since $\mathbb{Q}$ is countable and $\{q\}$ is nowhere dense we obtain $\mathbb{R}$ as a countable union of nowhere dense sets

Related Question