I'm looking at the following proof in my textbook.
Every open subset $\mathcal{O}$ of $\mathbb{R}$ can be written uniquely as a countable union of disjoint open intervals.
Proof. For each $x \in \mathcal{O}$, let ${I}_{x}$ denote the largest open interval containing $x$ and contained in $\mathcal{O}$. More precisely, since $\mathcal{O}$ is open, $x$ is contained in some small (non-trivial) interval, and therefore if
$$a_{x} = \inf\{a < x: (a,x) \subset \mathcal{O} \}$$ and $$b_{x} = \sup\{b>x:(x,b) \in \mathcal{O}\}$$
we must have $a_{x} < x < b_{x}$ (with possibly infinite values for $a_{x}$ and $b_{x}$). If we now let $I_{x} = (a_{x},b_{x})$, then by construction we have $x \in I_{x}$ as well as $I_{x} \subset \mathcal{O}$.
Hence $$\mathcal{O} = \bigcup_{x \in \mathcal{O}} I_{x}$$
Now suppose that two intervals $I_{x}$ and $I_{y}$ intersect. Then their union (which is also an open interval) is contained in $\mathcal{O}$ and contains $x$. Since $I_{x}$ is maximal, we must have $(I_{x} \cup I_{y}) \subset I_{x}$, and similarly $(I_{x} \cup I_{y}) \in I_{y}$. This can happen only if $I_{x} = I_{y}$; therefore, any two distinct intervals in the collection $\mathcal{I} = \{I_{x}\}_{x \in \mathcal{O}}$ must be disjoint. The proof will be complete once we have shown that there are only countably many distinct intervals in the collection $\mathcal{I}$. This, however, is easy to see, since every open interval $I_{x}$ contains a rational number. Since different intervals are disjoint, they must contain distinct rationals, and therefore $\mathcal{I}$ is countable, as desired.
I have a few questions.
Why do we have possibly infinite values for $a_{x}$ and $b_{x}$?
Is $I_{x} \subset \mathcal{O}$ from the definition of supremum and infimum?
Why does $x \in I_{x}$ and $I_{x} \subset \mathcal{O}$ imply
$$\mathcal{O} = \bigcup_{x \in \mathcal{O}} I_{x}?$$