I got stuck in this proof.
First, we know that if $U$ is closed, then the complement $U^c$ is open.
Therefore, what I tried to do is use one of my previous results in another question. This is, that every open set in $\mathbb{R}$ is a countable union of disjoint open intervals.
Using the previous statement, simple set theory and De Morgan's Laws, we get
$$U = (U^c)^c = \bigg( \bigcup_{x\in U^c} I_x\bigg)^c = \bigg( \bigcap_{x\in U^c} I^c_x\bigg)$$
where $I_x$ are the intervals of the open set $U^c$. My problem is that we know that the intervals $I_x$ of $U^c$ are open, and, therefore the intervals $I^c_x$ are closed, which is the opposite of what I was trying to obtain.
I know there's another answer. Nevertheless, it is completely different to what I am trying to do. I want to know why this method does not work.