Prove that every open set in $\mathbb{R}$ is a disjoint union of open intervals [duplicate]

Here, we're using the standard topology in $\mathbb{R}$, and the endpoints are allowed to be positive and negative infinity.

-

marked as duplicate by Michael Greinecker♦, lhf, Carl Mummert, William, Jonas MeyerSep 18 '12 at 4:15

–  Siminore Sep 17 '12 at 9:57

Sketch proof: Let $U \subseteq \mathbb{R}$ be open. About every point $u \in U$ there is an open interval containing $u$ which lies wholly in $U$, and each such open interval contains a rational number. So we can write $U$ as a countable union of open intervals about rationals. Enumerate these rationals as $(q_n)_{n \in \mathbb{N}}$. You can get a collection of disjoint open intervals whose union is $U$ by taking each $q_n$ in turn $-$ if $q_n$ lies in a set already picked then throw it away; otherwise, choose $0 < a,b \le \infty$ maximal such that $(q_n-a, q_n+b) \subseteq U$. These chosen intervals are pairwise disjoint and their union is $U$.
Let $U \subseteq \mathbb{R}$ be open. Define a relation in $U$ by $x \sim y$ if there is an open interval $I \subseteq U$ such that $x,y \in I$. Prove that this is an equivalence relation and that its classes are open intervals.