Let $W^{1,p}(U)$ be the Sobolev space, where $U$ is a connected bounded domain in $\mathbb{R}^n$ and $u\in W^{1,p}(U)$ satisfying $Du=0$ a.e. in $U$. Then $u$ is constant a.e. in $U$.
I don't know how to prove this. Especially, I don't know how to use "connected".
Please guide me.
Let $\phi_\epsilon$ denote a mollifier and let $u_\epsilon = u*\phi_\epsilon$ is a smooth function in $\Omega_\epsilon := \{x \in \Omega \mid \mathop{\rm dist}(x, \partial\Omega) > \epsilon\}$. As $Du_\epsilon = Du*\phi_\epsilon = 0$ in $\Omega_\epsilon$, $u_\epsilon$ is locally constant in $\Omega_\epsilon$. Hence, as $u_\epsilon \to u$ allmost everywhere, $u$ is locally constant in $\Omega$. As $\Omega$ is connected, $u$ is constant allmost everywhere.