# Increasing sequence of step functions converging to $\chi_G$ where $G$ is open in $[a,b]$

Proposition 1. Let $I=[a,b]$ be a compact interval of $\mathbb{R}$. Let $G$ be an open set of $I$. Then there exists an increasing sequence of step functions $\{s_n\}$ defined on $I$ such that $s_n\nearrow \chi_{G}$ almost everywhere on $I$.

I was trying to prove it, so I first considered the case of $G$ being connected (I was thinking to consider the connected components of $G$, but if there were infinite I don't know how to do that). In this case, we can easily define a sequence $\{G_n\}_{n\in\mathbb{N}}$of compact subintervals of $G$ which satisfies:

\begin{align}(\forall n\in\mathbb{N}),G_n&\subset G\\ (\forall n\in \mathbb{N}), G_n&\subset G_{n+1}\\ \bigcup_{n\in\mathbb{N}}G_n&=G\end{align}

and then just take the sequence of functions given by $$s_n=\chi_{G_n}$$

If the set $G$ is not connected, how should I approach the problem?

If we supposed $G$ was closed, would there be some problem in the validity of the proposition? For example, we would be able to find a decreasing sequence for $\chi_{G}$, given an increasing sequence for the characteristic function of the complement (If $s_n\nearrow \chi_{G^c}$ then $1-s_n\searrow \chi_G$). So the problem might become to find a decreasing sequence for the case of $G$ being open.

Let $F: = G\cap \mathbb{Q}$ and consider an enumeration $a:\mathbb{N}\rightarrow F$. Then define $\chi_0(x)$ as the characteristic function of a neighbourhood of $a(0)$ which is contained in $G$ (here it is used that $G$ is open). If $\chi_k$ is alreay defined, define $\chi_{k+1}(x)=\max\{\chi_k(x), g_{k+1}(x)\}$ where $g_{k+1}$ is the characteristic function of a neighbourhood of $a(k+1)$ in $G$.
It should be clear that the sequence $\chi_k$ solves your problem at least the one about the open set.