A closed set is intersection of countable collection of open sets I am currently reading Apostol Mathematical Analysis. There was this question
Question : Prove that a closed set in $\mathbb{R}^1$ is the intersection of countable collection of open sets.
[Here $N_a(\varepsilon) =$ the open set $(a-\varepsilon, a+\varepsilon)$ ]
My Attempt : Let $A$ be a closed set. Let $A^c$ denote the complement of $A$. Take $G$ be a collection of neighborhoods where for each $N_a(\varepsilon)\in G $ where $a\in \mathbb{Q}\cap A^c=A'$(Let) and $\varepsilon$ is the minimum real number such that $A\subseteq N_a(\varepsilon) $
As the set of rational numbers are countable hence the set $G$ is also countable. Hence $$A=\bigcap_{S\in G}S$$
Can we write the last statement ?
 A: Here's an approach that works more generally in any metric space. As in the statement of the question, we will let $N_r(x)$ be the set of points whose distance to $x$ is less than $r$. For all $n$, let
$$U_n = \bigcup_{a \in A} N_{1/n}(a).$$
This is a union of open sets, and hence is open itself. I claim that
$$\bigcap_{n \in \Bbb{N}} U_n = A.$$
It's clear that $A \subseteq U_n$ for each $n$, simply because each $a \in A$ belongs in $N_{1/n}(a) \subseteq U_n$.
On the other hand, suppose that $x \notin A$. Then some open neighbourhood of $x$ exists that fails to intersect $A$, i.e. there is some $\varepsilon > 0$ such that $N_{\varepsilon}(x) \cap A = \emptyset$. Fix some $n$ such that $1/n < \varepsilon$. If we had $x \in U_n$, then some $a \in A$ exists such that $x \in N_{1/n}(a)$. That is, the distance from $x$ to $a$ is no larger than $1/n$, which is less than $\varepsilon$. But then $a \in N_\varepsilon(x) \cap A = \emptyset$, a contradiction. Therefore, $x \notin U_n$, and hence $x \notin \bigcap_{n \in \Bbb{N}} U_n$, completing the proof.
A: Let $C \subseteq \Bbb{R}$ be a closed subset, then $U := C^c$ is open and can be written as a countable union of open intervals with rational endpoints.
By De Morgan’s Laws, that means $C$ is a countable intersection of closed rays with rational endpoints.
So it suffices to show that any closed ray is a countable intersection of open sets. Since countably many closed rays intersect to form $C$, we would then have that $C$ can be expressed as a countable intersection of countable intersections of open sets, which is also a countable intersection of open sets.
But this is really easy: If our closed ray is unbounded above, i.e. of the form $R := [a, \infty)$ for $a \in \Bbb{Q}$, then our desired countable intersection of open sets would just be $$[a, \infty) = \bigcap_{n \geq 1} (a - 1/n, \infty).$$ You can mimic that construction in the case where the ray is unbounded below to get the same result, that the closed ray is a countable intersection of open sets. QED.
A: Following the idea of  @Rivers McForge:
Write every open subset as a union of open intervals.  We can write any open interval as
the union of those closed intervals with rational points contained inside it. Therefore,
every union of open intervals is also a union of some closed intervals with rational points. Now note that there are only countably many closed intervals with rational points.  Hence every open set is a countable union of closed intervals.
