Let $g_n(x)=[x\in (r_n,1]]$. Show that $G(x)=\sum_{n\ge 1} g_n(x)/2^n$ is Riemann-integrable I want to check if my proof about $G(x)$ is Riemann-Integrable in $[0,1]$ is correct.

Let $\{r_n\}$ an enumeration of the rationals in $[0,1]$, and $g_n(x)=[x\in (r_n,1]]$. Show that $G(x)=\sum_{n\ge 1} g_n(x)/2^n$ is Riemann-integrable in $[0,1]$.

where the expression $[x\in(r_n,1]]$ is an Iverson bracket.
If $x\in[0,1)$ and because exist some $r_m>x$ then
$$G(x)=\sum_{n\in\Bbb N}\frac{[x\in(r_n,1]]}{2^n}<\sum_{n\in\Bbb N}\left(\frac12\right)^n=1$$
And $G(1)=1$ and $G(0)=0$.
And we have that if $x<y$ then $G(x)<G(y)$ because the rationals are dense and exist some $r_{x,y}\in(x,y)$. Then we have that the function $G(x)$ is monotone and bounded in a closed interval then is Riemann-integrable.

For clarity I will add the proof for the last statement: without lose of generality suppose that $f(x)$ is bounded in a closed interval $[a,b]$ and if $x<y$ then $f(x)\le f(y)$. Because is increasing for some partition $P_n=\{a=x_1<x_2<\cdots<x_n=b\}$ we have that the difference between the lower and upper sum is
$$U(f,P_n)-L(f,P_n)=\sum_{k=1}^{n}(M_k-m_k)\Delta x_k=\sum_{k=1}^{n}(f(x_{k+1})-f(x_k))\Delta x_k$$
Then for the sequence of partitions $(P_n)$ such that $P_n=\{a+\frac{(b-a)k}{n}:0\le k\le n\land k\in\Bbb Z\}$ we have that
$$\begin{align}\lim_{n\to\infty}(U(f,P_n)-L(f,P_n))&=\lim_{n\to\infty}\sum_{k=1}^{n}\frac1n(f(a+(b-a)(k+1)/n)-f(a+(b-a)k/n))\\&=\lim_{n\to\infty}\frac1n (f(b)-f(a))=0\end{align}$$
So $f(x)$ is Riemann-integrable in $[a,b]$.

Please check my proofs and statements and said to me if something is wrong or can be expressed in a clearer way. Thank you!

I remember there is a  theorem.
Since $G(x)$ is bounded and increasing, also we know that $[0,1]$ is compact. And an increasing function has at most countable discontinuous points.
So it satisfies the conditions.
