Here's a sketch for $(-\infty, b)$. The $(a, \infty)$ case is similar.
Clearly there's no problem if $b$ is an integer (use dyadic intervals of length $1$ with integer endpoints). So it suffices to show that you can express $I = [\lfloor b \rfloor, b)$ as a disjoint union of dyadic intervals, where $\lfloor b \rfloor$ is the floor of $b$ (i.e., the greatest integer not exceeding $b$).
To do this, we build a pairwise disjoint collection of dyadic intervals as follows.
Let $a_1 = \lfloor b \rfloor$, and $b_1 = a_1 + 1/2$. Define $I_1 = [a_1, b_1)$. If $I_1 \subseteq I$, then add $[a_1,b_1)$ to the collection, otherwise don't. Then for general $n > 1$, if we kept $I_{n-1}$, then set $a_n = b_{n-1}$, otherwise set $a_n = a_{n-1}$. Let $b_n = a_n + 1/2^{n}$. Define $I_n = [a_n, b_n)$. If $I_{n} \subseteq I$, then add $I_n$ to the collection, otherwise don't.
Let $\mathcal N$ denote the set of indices $n$ for which we added $I_n$ to the collection.
It's easy to verify that the $I_n$ are pairwise disjoint and dyadic, and that $\bigcup_{n\in \mathcal N}I_n = I$. To see why the latter is true, observe that $0 \leq b - b_n < 1/2^n$, so $b_n \to b$ as $n \to \infty$.
Note that the indices in $\mathcal N$ correspond exactly to the indices where there are ones in the binary expansion of $b - \lfloor b \rfloor$. (Specifically, the terminating expansion, if there is one.)