I asked this question on MSE [here](https://math.stackexchange.com/q/1720572/254733) some time ago, but I couldn't get an answer. There was a suggestion in the comments for a counterexample using a fat Cantor set, but I couldn't show a contradiction with the statement in my question.


Let $\Omega\subset \mathbb R^d$ ($d=2,3$) is a bounded Lipschitz domain.



> 
> **Question:**
>  Is it true that for each function $g(x)\in L^2(\Omega)$ one can find a sequence $\{g\_n\}\_1^\infty$ of $H\_0^1(\Omega)$ functions such that $g\_n(x)\to g(x),\,a.e$ in $\Omega$ and $|g\_n(x)|\leq |g(x)|+\epsilon,\,a.e,\,\forall n\ge 1$ for some $\epsilon>0$ ?
> 
> 
> 


In the case when $g\in L^\infty(\Omega)$ and $m:=\|g\|\_{L^\infty(\Omega)}$, then also $g\in L^p(\Omega),\,1\leq p<\infty$ so there is $g\_n\in C\_0^\infty(\Omega)$ s.t $g\_n\to g$ in $L^p(\Omega)$ and from it we can extract a subsequence $g\_{n\_k}(x)\to g(x),\,a.e$. Finally, we construct the smooth function $\varphi:\mathbb R\to\mathbb R$ s.t $\varphi(t)=t,\,|t|\leq m+1$, $\varphi(t)=m+2,\,t>m+2$, $\varphi(t)=-m-2,\,t<-m-2$ and take the functions $\varphi\circ g\_{n\_k}$. These functions satisfy $\varphi\circ g\_{n\_k}(x)\to g(x),\,a.e$ and $|\varphi\circ g\_{n\_k}(x)|\leq m+2$.


**Remark:** It is easy to show (see for example Th. 4.9 in Brezis' book *Functional Analysis*) that for $g\_n\to g$ in $L^p(\Omega)$ there exists a subsequence $g\_{n\_k}$ s.t $g\_{n\_k}(x)\to g(x),\,a.e$ and $|g\_{n\_k}(x)|\leq h(x)$ for some $h\in L^p(\Omega)$. As $C\_0^\infty(\Omega)\subset H\_0^1(\Omega)$ is dense in $L^2(\Omega)$ we can find $g\_n\to g$ in $L^2(\Omega)$ and apply Th. 4.9, but then we get only $|g\_{n\_k}(x)|\leq h(x)$



$\forall g\in L^2(\Omega)$ exists $g_n\in H_0^1(\Omega)$ and $\epsilon>0$ s.t $g_n(x)\to g(x),\,a.e$ and $|g_n(x)|\leq |g(x)|+\epsilon$
I just stumbled on the following fact in Conway's complex analysis book, vol. 2, Lemma 19.11.6: If $f\in H\_0^1$, then, after modification on a null set, $f(x,y)$ will be (in fact: absolutely) continuous as a function of $x$ for fixed $y$. (Since it's a complex analysis book, it's done for $d=2$ there, but the proof works in any dimension.)


This means that the type of counterexample that was already suggested works. We can essentially work in one dimension: we take $\Omega\subseteq\mathbb R^d$ as the unit cube and $g(x,y)=h(x)$ with $h=0$ on a (dense open) set $A$ with $|A\cap I|>0$ for every open interval $I$ and $h=n$ on a set $C\_n$ with $|C\_n|=2^{-n}$ (use Cantor sets).


Then, by the continuity property reviewed above, a $g\_n\in H\_0^1$ with $|g\_n|\le g+M$ a.e. will satisfy $|g\_n|\le M$ a.e.


