Closed subsets of $\mathbb{R}$ characterization I remember the characterization of open subsets of $\mathbb{R}$ as a countable union of disjoint open intervals. I was thinking about whether this allows us to characterize closed subsets as a countable union of disjoint closed intervals. As we know, closed subsets are just complements of open subsets.
I had an idea of starting with an open interval at $(a,b)$, then looking at the next open interval to the right at $(c,d)$, and concluding that $[b,c]$ belongs to the closed subset. But this idea can break down, for example, if the open subset contains the intervals $(-1,0), (1/2,1), (1/8,1/4), (1/32,1/16), \ldots$. In this case, there is no next open interval to the right of $(-1,0)$. How can we modify this idea to characterize closed subsets?
 A: Although closed sets in $\mathbb R$ are not necessarily countable unions of disjoint closed intervals, they are countable intersections of complements of disjoint open intervals. 
A: To see that closed subsets of $\mathbb R$cannot be characterized countable unions of disjoint closed intervals, note that the set $[\frac12,1]\cup[\frac14,\frac13]\cup[\frac16,\frac15]\cup\dots$ is a countable union of disjoint closed intervals, but is not closed.
A: It’s not true that all closed sets are countable unions of disjoint closed intervals: the middle-thirds Cantor set is a counterexample. It is closed and nowhere dense in $\Bbb R$, so it contains no non-trivial closed interval. That is, the only closed intervals that it contains are degenerate ones of the form $[x,x]=\{x\}$. And since it is uncountable, it isn’t a countable union even of these degenerate closed intervals.
A: Using a bit of set theory, one way to classify closed sets is by means of the Cantor-Bendixson derivative. This is not as clean as the characterization of open sets as countable unions of disjoint intervals, but allows us to distinguish some closed sets from others depending on how "complex" their limit points are, so in a sense indicates why there is not a satisfactory analogue of the case of open sets.
The derivative of a set $A$ is the set $A'$ consisting of all limit points of $A$, that is, $a\in A'$ iff there is a sequence of distinct points of $A$ with limit $a$. The set $A'$ is always closed and, if $A$ is closed, then $A'\subset A$.
We can use this to define a transfinite sequence of iterated derivatives of a given closed set $C$:


*

*$C_0=C$.

*Given $C_\alpha$, let $C_{\alpha+1}=C_\alpha'$.

*For $\lambda$ a limit ordinal, define $C_\lambda=\bigcap_{\alpha<\lambda}C_\alpha$.


Recall that a non-empty set $P$ is perfect iff every point of $P$ is a limit point of $P$, so $P'=P$. The Cantor set, mentioned in Brian's answer, is an example of a perfect set.
Since $$C_0\supseteq C_1\supseteq\dots\supseteq C_\alpha\supseteq\dots,$$ eventually we must reach an $\alpha$ such that $C_\alpha=C_{\alpha+1}=C_{\alpha+2}=\dots$, that is, $C_\alpha$ is either empty, or perfect. One can also verify that the first such $\alpha$ is countable; this is because if $p\in A\setminus A'$, then there is an interval centered at $p$ and disjoint from $A'$. One can use this to associate to each $p\in A\setminus A'$ a rational number, and this process can be carried out in such a way that for any $\beta$, the rationals we associate to points $p\in C_\beta\setminus C_{\beta+1}$ are not used at any stage other than $\beta$. Since we only have countably many rationals, the process necessarily stabilizes at a countable stage. (For details of this argument, see either Kechris's book on Descriptive set theory, or Jech's set theory book.) This also shows that $A\setminus A'$ is countable, and therefore (since countable unions of countable sets are countable) that if $\alpha$ is the stage where the derivatives stabilize, then $C\setminus C_\alpha$ is countable as well.
The above shows that any closed set $C$ has the form $A\cup P$ where $A$ is countable, $P$ is either empty, or perfect, and $A\cap P=\emptyset$. Writing $A_\alpha\subset A$ for $C_\alpha\setminus P$, there is a countable ordinal $\alpha$ such that $A_\alpha=\emptyset$.
This gives us a classification of closed sets: 

  
*
  
*If $C,D$ are closed, $C$ is countable and $D$ is not, then $C$ is simpler than $D$.
  
*If $C$ and $D$ are countable, then $C$ is simpler iff $C_\alpha=\emptyset$ for some $\alpha$ such that $D_\alpha\ne\emptyset$. 
  
*If $C$ and $D$ are uncountable, so $C=A\cup P$ and $D=B\cup Q$ with $A,B$ countable, $P,Q$ perfect, and $A\cap P=B\cap Q=\emptyset$, then $C$ is simpler iff $A_\alpha=\emptyset$ for some $\alpha$ with $B_\alpha\ne\emptyset$.
  
*Sets that are not distinguished this way are said to have the same complexity.
  

For each countable $\alpha$, there are closed sets such that $C_\alpha=\emptyset$ and $\alpha$ is least for which this happens. This tells us that in a sense there are many different levels of complexity of closed sets ($\omega_1$ many). For example, the empty set is trivial. After this, a finite set of points is as simple as it gets, and $C_1=\emptyset$ in this case. For an increasing sequence with its limit, we need to wait until $C_2$ to reach an empty set. For an increasing sequence with limit $1$ followed by an increasing sequence with limit $1.5$, followed by an increasing sequence with limit $1.75,\dots$, followed by $2$, we have $C_1=\{1,1.5,1.75,\dots\}\cup\{2\}$, $C_2=\{2\}$, $C_3=\emptyset$. Etc. The idea is that the larger $\alpha$ is the more complex the closed set is. For example, in the set just described, we have isolated points, points that are limits of isolated points, and points that are limits of limits of isolated points, but nothing more. Something that has, say, limits of limits of limits of limits of limits of isolated points, is more complex. 
Note that this classification of closed sets could stand some improvement, since it does not distinguish between perfect sets. Sets that are like Cantor's set are easy to describe, see here. We can go a bit further: If $A$ is closed and contains an interval, we could "identify" all the points in the interval, and think of them as a single point, and then proceed with the classification described above. This gives us a way to distinguish $[0,1]$ from $$[0,1/2]\cup[3/4,7/8]\cup[15/16,31/32]\cup\dots\cup\{1\}:$$ They are both perfect, but the second one is more complex. Again, this does not seem to be a refined enough approach, and I do not know of a satisfactory way of distinguishing among perfect sets in general. (It may be this is all there is, and anything that "reaches the end" of this process is a Cantor set, perhaps unbounded.)
It may be natural to wonder what precisely is the relation between this classification and your question. As the examples in other answers point out, closed sets do not need to be given as countable unions of disjoint closed intervals. Saying that they are the intersection of the complements of disjoint closed intervals is also a bit unsatisfactory, since this does not seem to give us any intrinsic information beyond "the complement is open". Now, since the complement is open, then we could attempt to understand closed sets by seeing how the open intervals in the complement relate to each other. To say of a point $p\in C$ that there are two intervals in the complement of $C$, one precisely to the right of $p$, and one precisely to its left, is simply to say that $p$ is isolated. To say that there is no such interval, but there is a sequence of intervals to the left, "converging" to $p$, such as $(0,1),(1,1.5),(1.5,1.75),\dots$ "converges" to $2$, is to say that $p$ is a limit of isolated points from the left. Etc. Hence, to understand how these open intervals "sit" in the complement of $C$ is the same as understanding the "limit" nature of the points of $C$, which is precisely what the Cantor-Bendixson derivative allows us to do. 
