Here is the proof of this proposition from my Real Analysis textbook.
Proposition 1.5. Suppose $G \subset \mathbb{R}$ is open. Then $G$ can be written as the countable union of disjoint open intervals.
Proof. Let $G$ be an open subset of the real line and for each $x \in G$, let$$A_x = \inf\{a : \text{there exists }b\text{ such that }x \in (a, b) \subset G\}$$and$$B_x = \sup\{d : \text{there exists }c \text{ such that }x \in (c, d) \subset G\}.$$Let $I_x = (A_x, B_x)$.
We prove that $x \in I_x \subset G$. If $y \in I_x$, then $y > A_x$, and so there exist $a$ and $b$ such that $A_x < a < y$ and $x \in (a, b) \subset G$. Because $y < B_x$ there exist $c$ and $d$ such that $y < d < B_x$ and $x \in (c, d) \subset G$. The point $x$ is in both $(a, b)$ and $(c, d)$, hence their union $J = (\min(a, c), \max(b, d))$ is an open interval. $J$ will be a subset of $G$ because both $(a, b)$ and $(c, d)$ are. Both $x$ and $y$ are greater than $a > A_x$ and less than $d < B_x$, so $x \in I_x$ and $y \in J \subset G$.
We next argue that if $x \neq y$, then either $I_x \cap I_y = \emptyset$ or else $I_x = I_y$. Suppose $I_x \cap I_y \neq \emptyset$. Then $H = I_x \cup I_y$ is the union of two open intervals that intersect, hence is an open interval, and moreover $H \subset G$. We see that $H = (\min(A_x, A_y), \max(B_x, B_y))$. Now $x \in I_x \subset J \subset G$. It follows form the definition of $A_x$ that $A_x \le \min(A_x, A_y)$, which implies that $B_x \ge B_y$. Hence $I_y \subset I_x$. Reversing the roles of $x$ and $y$ shows that $I_x \subset I_y$, hence $I_x = I_y$.
We therefore have established that $G$ is the union of a collection of open intervals $\{I_x\}$, and any two are either disjoint or equal. It remains to prove that there are only countably many of them. Each open interval contians a rational number and the rational numbers corresponding to disjoint open intervals must be different. Since there are only countably many rationals, the number of disjoint open intervals making up $G$ must be countable.
I can follow this proof line by line, but I'm curious. What is the intuition behind this proof? What are the one to three key ideas this proof boils down to?