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!
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.