Monotone approximating sequence for measurable function Let $f\in L^2(K)$ (with values in $\mathbb{R})$, where $K\subseteq\mathbb{R}^n$ is compact. Then one knows that there exists a sequence $f_n$ of continuous functions on $K$ that converges pointwise almost everwhere to $f$. For example one can get this by judiciously taking a subsequence of a sequence of continuous functions converging to $f$ in $L^2(K)$.
I'm wondering, is it possible to get a sequence of continuous functions $f'_n$ that converges to $f$ pointwise almost everywhere, with the property that $f'_n(x)\geq f'_m(x)$ whenver $n\geq m$?
Thanks!
 A: No, this is not possible in general.  For instance, let $C\subset[0,1]$ be a fat Cantor set (a closed set with positive measure but empty interior) and let $f\in L^2([0,1])$ be the characteristic function of $C$.  If $g$ is continuous and $g\leq f$ almost everywhere, then $g\leq 0$ everywhere.  Indeed, if there were a point $x$ such that $g(x)>0$, then by continuity there would be a nonempty open set $U$ such that $g(y)>0$ for all $y\in U$.  But then since $g\leq f$ almost everywhere, $U$ must be almost contained in $C$, which is impossible since $C$ has empty interior.
So, in particular, if $(f_n)$ is an increasing sequence of continuous functions with limit $f$ almost everywhere, then $f_n\leq f$ almost everywhere for each $n$, and so $f_n\leq 0$ everywhere.  This would mean that $f\leq 0$ almost everywhere, which is false.
A: WARNING: This example produces an approximation with functions of the form $f_n(x)=\sum_{j=-\infty}^\infty c_j \, \mathbf 1_{A_j}(x)$, where the $A_j$'s are measurable sets. So the approximating functions are not continuous.

Consider a sequence $\phi_n\colon \mathbb R\to \mathbb R$ such that 
$$
\lim_{n\to \infty} \phi_n(y)=y, \qquad \phi_{n+1}(y)\ge \phi_n(y).$$
Such sequences exist, take for example 
$$
\phi_n(y) = [n y], $$ 
where $[\cdot]$ denotes floor function. The approximating sequence $f_n(x)=\phi_n(f(x))$ satisfies the required properties.
