Every open set in $\mathbb{R}$ is the union of an at most countable collection of disjoint segments

I don’t know what argument you used, but here’s the easiest one that I know.

Let $U$ be a non-empty open subset of $\Bbb R$. Define a relation $\sim$ on $U$ as follows: for $x,y\in U$, $x\sim y$ iff either $x\le y$ and $[x,y]\subseteq U$, or $y\le x$ and $[y,x]\subseteq U$. It’s not hard to check that $\sim$ is an equivalence relation. For $x\in U$ denote by $U(x)$ the $\sim$-equivalence class of $x$. Then $U(x)$ is order-convex and open in $\Bbb R$.

  1. $U(x)$ is order-convex. Suppose that $y,z\in U(x)$ with $y<z$. If $x\le y$, then $[y,z]\subseteq[x,z]\subseteq U(x)$. If $z\le x$, then $[y,z]\subseteq[y,x]\subseteq U(x)$. And if $y<x<z$, then $[y,z]=[y,x]\cup[x,z]\subseteq U(x)$.

  2. $U(x)$ is open. Suppose that $y\in U(x)$. Suppose that $x<y$. $U$ is open, so there are $u,v\in\Bbb R$ such that $y\in(u,v)\subseteq U$. Let $w\in (y,v)$ be arbitrary. Then $[x,w]=[x,y]\cup[y,w]\subseteq U$, so $y\in(x,w)\subseteq U(x)$. The case $y<x$ is entirely similar, and the case $y=x$ is trivial.

Thus, $\{U(x):x\in U\}$ is a partition of $U$ into order-convex open sets. Since each must contain a rational numbers, there are only countably many of these sets.

Note that the result fails if you insist on having bounded open intervals. If $(a,b)$ is one of the intervals in the decomposition of $U$, no other interval can contain either $a$ or $b$. Thus, if $U$ contains an open ray, $U$ cannot be decomposed into pairwise disjoint bounded open intervals.

Let $E$ be an open subset of $\mathbb{R}$. We can assume without loss of generality that E is nonempty. Consider a real number $x \in E$. In the context of this problem, a segment $(a_1,b_1)$ means the set of all $p \in \mathbb{R}$ such that $a_1 \lt p \lt b_1$. $ $Let $y = inf \lbrace a \in E \mid (a,x) \subseteq E \rbrace$ and $w = sup \lbrace a \in E \mid (x,a) \subseteq E \rbrace$. Then $E$ is the union of all such segments $(y,w)$ for all points $x \in E$. Since each of these segments is open, it remains to show that they are at most countable. First, note that the rationals are known to be dense in the reals. Also, the rationals are a countable set. Thus, let $\lbrace r_n \rbrace$ be an ordering of the rational numbers. Now order the segments $(y,w)$ such that $(y_1,w_1)$ precedes $(y_2,w_2)$ if and only if the least $i$ such that $r_i \in (y_1,w_1)$ is less than the least $j$ such that $r_j \in (y_2,w_2)$. $r_i$ and $r_j$ exist because the rationals are dense. This is an ordering of the segements whose union is $E$, showing that the segments are at most countable.