Weak derivative zero implies constant function
Solution 1:
By (well-known) properties of mollification, $u*\rho_\epsilon\rightarrow u$ in $W^{1,p}$ as $\varepsilon \rightarrow 0$. Since $u*\rho_\epsilon = c_\varepsilon$ is a constant for each $\varepsilon$, and $u*\rho_\epsilon\rightarrow u$, $u$ is the limit of constant functions and must be constant as well (e.g. because convergence in $L^p$ implies convergence a.e.).
you should note that
i) this is only true for each connected component of $U$
ii) strictly speaking $u*\rho_\epsilon$ is only defined on $U_\varepsilon = \{x\in U: d(x,\mathbb{R}^n\backslash U)>\varepsilon\}$, so you first get the result for any such domain, but then it it true for $U$ if $\varepsilon$ tends to $0$.