Let $\{P_i\}_{i=1}^\infty$ be a sequence of partitions of the interval $[0,1]$ with a vanishing mesh. Additionally $H_i$ be the space of piecewise constant functions (step functions) with pieces defined by $P_i$.
I want to prove that for all $x\in L^2([0,1])$ there exists a sequence $\{x_i\}_{i=1}^\infty$ of $x_i\in H_i$ such that $\lim_{i\to\infty}\lVert x_i -x\rVert_{L^2} = 0$.
When the sequence of partitions is nested the proof is simple, I can prove it constructivelly. Roughly, let $\{\phi_j\}_{j=1}^\infty$ be a sequence of continuous such that $\phi_j\to x$, which exists due to denseness of continuous functions in $L^2$, and $\xi_{ij}\in H_i$ be the piecewise constant interpolation of $\phi_j$ at $P_i$. Then $\lim_{i\to\infty}\xi_{ij} =\chi_j$ and $x_i$ can be chosen as the $\xi_{kj}$ for $k,j\in\{1,\dotsc,i\}$ that is closer to $x$ making $\lVert x_i - x \rVert_{L^2}$ a monotonically decreasing sequence such that $x_i\to x$.
I am interested in the general case (partitions not necessarily nested), mostly out of curiosity to work out epiconvergence of discretized optimal control problems with general partition sequences. Polak (1997), mentions that the requirement that the partitions be nested is mostly for convenience. I struggled to prove this yesterday before giving up. It seems like an interesting exercise, however.
This question is similar to Approximation in $L^2$ by piecewise constant functions.