Every open set in $\mathbb{R}$ is a disjoint union of open intervals: I'm struggling to follow the disjoint constraint The general idea of the proof our professor showed us was like this: let $O \subset \mathbb{R}$ be an open set, and take any $x \in O$. Now $O$ is bounded so any interval contained in $O$ has an infimum and supremum. So define
$$b = \sup\{y \in \mathbb{R} : (x,y) \subseteq O\}$$
$$a = \inf\{z \in \mathbb{R} : (z,x) \subseteq O\}$$
Let $(a,b) := I_x$. It must be that $I_x \subset O$ For any $x$ we choose in $O$. Therefore  $\bigcup\limits_{x \in O} I_x \subseteq O$ 
Conversely, $x \in I_x$ for all $x \in O$. Therefore $O \subseteq \bigcup\limits_{x \in O} I_x$.
So $O = \bigcup\limits_{x \in O} I_x$
The second part is to prove that this union of open sets is disjoint, however without even considering this part of the proof I am confused. It seems to be that $a$ and $b$ should just be the infimum and supremum of $O$ no matter what value of $x$ we choose. Therefore all of the sets in the union $\bigcup\limits_{x \in O} I_x$ are the same. However I know this isn't true because Lindelöf's theorem is necessary to filter out duplicates leaving only the distinct union of intervals.
I am wondering how two sets in $\bigcup\limits_{x \in O} I_x$ could possibly be distinct if $(a,b)$ seems to be the same for any $x$.

To see that $a$ and $b$ need not be $\sup O$ or $\inf O$, note that $O$ need not be 'connected'. That is, consider the open set $O=(0,1) \cup (2,3)$. Then $(0,3)$ is not a subset of $O$, is it? In this case, $b=1$ if $x \in (0,1)$ and $b=3$ if $x \in (2,3)$. similarly for $a$.  
Now, let $x \ne y$ be in $O$. We want to show $I_{x}$ and $I_{y}$ are disjoint. But this is not quite true. In the example above, $x=1/2$ and $y=1/3$ have $I_{x}=I_{y}=(0,1)$, which are certainly not disjoint! Instead, we will show that $I_{x}$ and $I_{y}$ are either disjoint, or the same. This still shows that $O$ is the disjoint union of open intervals, but the union is not quite $\bigcup_{x \in O}I_{x}$
So suppose $z \in I_{x} \cap I_{y}$. Intuitively, $I_{z}$ is the largest interval containing $z$ that is inside of $O$. But $I_{x}$ and $I_{y}$ both contain $z$! So $I_{x}\subset I_{z}$ and $I_{y} \subset I_{z}$. But then $x \in I_{z}$ and $y \in I_{z}$, so similarly $I_{z} \subset I_{x}$ and $I_{z} \subset I_{y}$. So $I_{x}=I_{z}=I_{y}$, so we're done!
