Let $\Omega \subset \mathbb{R}$, bounded and regular. Prove that if $u \in H^1(\Omega)$, then $|u| \in H^1(\Omega)$?
$H^1(\Omega)=\{u \in L^2(\Omega) \mbox{ s.t } \partial_x u \in L^2(\Omega)\}$
Let $\Omega \subset \mathbb{R}$, bounded and regular. Prove that if $u \in H^1(\Omega)$, then $|u| \in H^1(\Omega)$?
$H^1(\Omega)=\{u \in L^2(\Omega) \mbox{ s.t } \partial_x u \in L^2(\Omega)\}$
Let $\delta>0$ and define $f_\delta:\mathbb{R}\to [0,\infty)$ by $$ f_\delta(x) = \left\{ \begin{array}{rl} \sqrt{x^2+\delta^2}-\delta &\mbox{ if $x\ge0$} \\ 0 &\mbox{ otherwise} \end{array} \right. $$
Note that $f_\delta\in C^1$ and $f_\delta(x)\to g(x)$ for all fixed $x$, where $g(x)=x$ if $x\ge 0$ and $g(x)=0$ if $x<0$. Consider the sequence $u_\delta=f_\delta (u)$. You can easily check that $f_\delta(u)\in H^1(\Omega)$ and $$\int_\Omega f_\delta(u)\frac{\partial\varphi}{\partial x_i}=\int_\Omega f'_\delta (u)\frac{\partial u}{\partial x_i}\varphi,\ \forall\ \varphi\in C_0^\infty(\Omega) \tag{1}$$
Now you can verify the hypothesis of Lebesgue theorem both for $f_\delta(u)$ and $f'_\delta(u)$ to conclude that $f_\delta (u)\to |u|$ in $L^2$ and $f'_\delta (u)\to \chi(u)$ where $\chi$ denotes the characteristic function of $u$ in the set where $u> 0$.
Remark: There is a more general result, which is called Stampacchia's theorem, and contains the previous result.
Remark 2: Note that $\Omega\subset\mathbb{R}$ is not necessary here.