Let $p \in [1, \infty)$ and $\lambda$ be the Lebesgue measure on $\mathbb R$. Let $L^p (\mathbb R)$ be the space of measurable functions $f:\mathbb R \to \mathbb R$ where $|f|^p$ is $\lambda$-integrable. Let $\mathcal I := \{1_I : I \text{ bounded open interval of } \mathbb R\}$. I'm trying to prove below density property, i.e.,
Theorem $\operatorname{span} \mathcal I$ is dense in $L^p (\mathbb R)$.
Could you have a check on my below attempt?
Proof Let $\mathcal S := \{1_S : S \in \mathcal B (\mathbb R) \text{ and } \lambda(S) < \infty\}$. Then $\operatorname{span} (\mathcal S)$ is dense in $L^p (\mathbb R)$. Fix $1_S \in \mathcal S$. It suffices to approximate $1_S$ in $L^p$ by an element in $\operatorname{span} \mathcal I$. Because $\lambda$ is outer regular, we can approximate $1_S$ in $L^p$ by $1_O$ where $S \subset O$ and $O$ is open in $\mathbb R$. Then we can approximate $1_O$ in $L^p$ by $1_{O'}$ where $O' \subset O$ and $O'$ is bounded and open in $\mathbb R$. It's well-known that any open subset of $\Bbb R$ is a countable union of disjoint open intervals. So $O' = \bigcup_{n} I_n$ where $(I_n)$ is a sequence of pairwise disjoint sets in $\mathcal I$. By continuity of measure from below, we can approximate $1_{O'}$ by a finite sum of elements of $(I_n)$. This completes the proof.