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.