Suppose we have $E\subseteq [a,b]$ is a measurable set. How do we prove that for all $\epsilon>0$, there exists finitely many disjoint closed intervals $\{[a_i,b_i]\}_{i=1}^N$ in $[a,b]$ such that $$|\{x\in [a,b]:\chi_E\neq\chi_{\bigcup[a_i,b_i]}\}|<\epsilon$$?
I have made an attempt, not sure if it is ok:
Let $\epsilon>0$. Write $E=\bigcup E_k$, where $E_k$ are disjoint measurable components of $E$. Since $E\subseteq [a,b]$, only finitely many $E_k$ has nonzero measure say $|E_1|,\dots, |E_N|>0$.
For $1\leq k\leq N$, since $E_k$ is measurable, there exists a closed set $F_k\subseteq E_k$ such that $|E_k\setminus F_k|<\epsilon/N$.
Let $[a_k, b_k]$ be the smallest closed interval containing $F_k$. Then $|E_k\setminus [a_k, b_k]|\leq|E_k\setminus F_k|<\epsilon<N$.
So $$|\{x\in [a,b]:\chi_E\neq\chi_{\bigcup[a_i,b_i]}\}|=\sum_{k=1}^N|\{x\in E_k: \chi_{E_k}\neq\chi_{[a_k, b_k]}\}|<\epsilon/N\cdot N=\epsilon$$
It is clear that $[a_k, b_k]$ are disjoint since $F_k$ are disjoint.
Anything wrong here? Thanks.
I don't understand why finitely many of the $E_k$ should have non-zero measure. Take a look at $$E=\left[\dfrac{1}{2},1\right]\cup\left[\dfrac{1}{4},\dfrac{3}{8}\right]\cup\left[\dfrac{1}{8},\dfrac{3}{16}\right]\cup\cdots$$ for instance. All you can say is that the series $$\sum_{k\geq 1}|E_k|$$ is convergent.