TITLE: countable family of open sets
QUESTION [11 upvotes]: Is there a countable family of open subsets of ${\bf R}$ or $[0,1]$ such that each rational belongs to only finitely many of the open sets and each irrational belongs to infinitely many of the sets?

REPLY [5 votes]: It's a fact (which I'm not going to use except as motivation) that any two countable dense subsets of $\mathbb R$ are "equivalent" in the sense that there is a homeomorphism of $\mathbb R$ with itself that maps one to the other. Therefore, if the statement you want to prove is true, it remains true if the set $\mathbb Q$ of all rational numbers is replaced with any other countable dense subset of $\mathbb R$. Hence it seems natural to seek a proof which is set-theoretical rather than arithmetical.
In fact, the set doesn't even have to be dense; if $A$ is any countable subset of $\mathbb R$, there is a countable family $\mathcal U$ of open sets such that no element of $A$, but every element of $\mathbb R\setminus A$, belongs to infinitely many members of $\mathcal U$.
Case 1. $A$ is finite.
Let $U$ be the collection of all rational open intervals which are disjoint from $A$.
Case 2. $A$ is countably infinite.
Let $A=\{a_n:n\in\mathbb N\}$ (enumerated without repetition) and let $\mathcal U=\{U_n:n\in\mathbb N\}$ where $U_n=\mathbb R\setminus\{a_1,\dots,a_n\}$.
The statement is still true, but slightly less trivial, if you want the members of $\mathcal U$ to be bounded open intervals. Suppose $A=\{a_n:n\in\mathbb N\}$. Let
$$\mathcal U=\mathcal W\cup\bigcup_{n\in\mathbb N}\mathcal V_n$$
where $\mathcal W$ is the set of all rational open intervals disjoint from $A$, and $\mathcal V_n$ is the set consisting of the bounded components of $\mathbb R\setminus\{a_1,\dots,a_n\}$ together with the intervals $(L_n-1,L_n)$ and $(R_n,R_n+1)$ where $L_n=\min\{a_1,\dots,a_n\}$ and $R_n=\max\{a_1,\dots,a_n\}$. It is easy to see that $\{U\in\mathcal U:x\in U\}$ is finite if $x\in A$, infinite if $x\notin A$.