I am trying to prove this and there is something that I am missing.
Let $E\subseteq\mathbb{R}$ and let us define an equivalence relation on E as follows. If $a\in E$ and $b\in E$ we say that $a\sim b$, if the entire open interval $(a,b)$ is contained in $E$.
Now, if I accept that this equivalence relationship partitions E into a disjoint union of classes, we can easily prove that:
an equivalence class is an interval and it's open
since $\mathbb{Q}$ is dense in $\mathbb{R}$, and $\mathbb{Q}$ is countable, we can pick a rational to associate with each $(a,b)$
And we are done.
My issue is: since we specify that $(a,b)$ are open disjoint intervals, how can they partition $E$? In particular, what happens to the boundaries $a$ and $b$? We may pick them to be in $E$, sure, but the collection of open intervals bounded by $a_i$ and $b_i$, $i<\infty$, will exclude $a_i$ and $b_i$, thus not covering $E$. So say $E=(1,3)$. The element $2\notin(1,2)\cup (2,3)$. What am I missing?