$\mathbf{Q}$ is not a countable intersection of open sets $\rightarrow$? I need help understanding a statement. I have been told that :
$\mathbf{Q}\subset\mathbf{R}$ is not a countable intersection of open sets. In other words, $\mathbf{Q}\neq\bigcap\limits_{i=1}^{\infty}U_i$ (where each $U_i$ is open). This implies that there is no function $f:\mathbf{R}\rightarrow\mathbf{R}$ such that $f$ is continuous at every $x\in\mathbf{Q}$ and is discontinuous at every $x\notin\mathbf{Q}$
I am not sure how the first two sentences imply the last one. 
 A: A subset of $\mathbb R$ is called a $G_{\delta}$-set if it is the intersection of countably many open sets.
Theorem. For any function $f:\mathbb R\to\mathbb R$, the set of all points at which $f$ is continuous is a $G_{\delta}$-set.
Proof. Let a function $f:\mathbb R\to\mathbb R$ be given. For each $n\in\mathbb N$, let $U_n$ be the union of all open sets $D$ such that $|f(x)-f(y)|\lt\frac1n$ for all $x,y\in D$, and let $A=\bigcap_{n=1}^{\infty}U_n$. Clearly $A$ is a $G_{\delta}$-set, being the intersection of the open sets $U_n$. It is easy to verify that $f$ is continuous at a point $x_0\in\mathbb R$ if and only if $x_0\in A$.
Theorem. A countable dense subset of $\mathbb R$ cannot be a $G_{\delta}$-set.
Proof. Let $A=\{a_n:n\in\mathbb N\}$ be a dense subset of $\mathbb R$, and assume for a contradiction that $A=\bigcap_{n=1}^{\infty}U_n$ where each $U_n$ is an open set. Since $A$ is dense, each $U_n$ is dense. Let $I_0$ be some closed interval (understood to be of the form $[a_0,b_0]$ with $a_0\lt b_0$). Inductively define for each $n\in\mathbb N$ a closed interval $I_n\subseteq I_{n-1}$ so that $a_n\notin I_n$ and $I_n\subseteq U_n$. The intersection of the nested closed intervals $I_n$ contains a point $x$, which must be in $A$ since it is in each $U_n$, but is not equal to any $a_n$. This contradiction proves the theorem.
A: If such function exists, then we can consider
$$A=\{x\in\Bbb{R}:f(x)\text{ is continuous at }x\}.$$
But it is known that the set of points of continuity of a real function is $G_\delta$.

Related posts


*

*How to show that the set of points of continuity is a $G_\delta$
