"If $x\in[0,1]$, we will use a repeated bisection procedure to associate a sequence $(a_n)$ of $0$s and $1$s as follows. If $x\neq\frac{1}{2}$ belongs to the left subinterval $[0,\frac{1}{2}]$ we take $a_1:=0$, while if $x$ belongs to the right subinterval $[\frac{1}{2},1]$ we take $a_1:=1$. If $x=\frac{1}{2}$, then we may take $a_1$ to be either $0$ or $1$. In any case we have" $$\frac{a_1}{2}\leq x\leq\frac{a_1+1}{2}$$
My question is: I don't understand where this inequality is coming from or what it even represents. I'm also lost as to how they obtain the next inequalities for when they split it up into more subintervals i.e. $$\frac{a_1}{2}+\frac{a_2}{2^2}\leq x\leq\frac{a_1}{2}+\frac{a_2+1}{2^2}\Longrightarrow \frac{a_1}{2}+\frac{a_2}{2^2}+\cdots+\frac{a_n}{2^n}\leq x\leq \frac{a_1}{2}+\frac{a_2}{2^2}+\cdots+\frac{a_n+1}{2^n}$$
Work it through. $a_0$ equals either 0 or 1, so the inequality is either $0 \le x \le 1/2$ or $1/2 \le x \le 1$.
In other words, "if $a_0/2 \le x \le (a_0 + 1)/2$, solve for a_0".
Let's work this out with an example. Let $ x = 0.578125$
1/2 = .5
1/4 = .25
1/8 = .125
1/16 = .0625
1/32 = .03125
1/64 = .015625
$x = 0.578125 = .5 + .078125 = .5 + .0625 + .015625 = 1/2 + 1/16 + 1/64$
So $a_0 = 1, a_1 = 0, a_2 = 0, a_3 = 1, a_4 = 0, a_5 = 1$ Because these are the values that solve
$a_0/2 \le x \le (a_0 + 1)/2$ (i.e. $1/2 \le x \le 1$)
$a_0/2 + a_1/4 \le x \le a_0/2 + (a_1 + 1)/4$ (i.e. $1/2 \le x \le 1/2 + 1/4$)
$a_0/2 + a_1/4 + a_2/8 \le x \le a_0/2 + a_1/4 + (a_2 +1)/8$ (i.e. $1/2 \le x \le 1/2 + 1/8$)
$a_0/2 + a_1/4 + a_2/8 + a_3/16 \le x \le a_0/2 + a_1/4 + a_2/8 + (a_3 + 1)/16$ (i.e. $1/2 + 1/16 \le x \le 1/2 + 2/16$)
and so on.
$0.578125_{10} = 0.100101_2$.