If $\int_{\Omega} u(x) ~\text{div} \phi(x) ~\text{d}x =0$ for all $\phi \in W_0^{1,2}(\Omega,\mathbb{R}^d)$, then $u=\text{constant}$? I want to take the weak gradient operator
$$ \begin{aligned} \nabla: L^2(\Omega) &\to W^{-1,2}(\Omega,\mathbb{R}^d) \\ \langle \nabla u, \phi \rangle_{W^{-1,2},W_0^{1,2}}&:=(u,\text{div}\phi)_{L^2}=\int_\Omega u(x) \,\text{div}\phi(x) ~\text{d}x \end{aligned} $$
for all $\phi \in W_0^{1,2}(\Omega,\mathbb{R}^d)$. 

Assume $\nabla u=0$. Show that $u$ is constant. 

I know that if I interpret $u$ as a tempered distribution and take the gradient as a distributional derivative it should be possible to conclude $u$ is constant. But I'd like to take the definition of the weak gradient operator above.
We have
$$ \int_\Omega u(x) \,  \text{div}\phi(x) ~dx=0 \text{ for all } \phi \in W_0^{1,2}(\Omega,\mathbb{R}^d).$$
If $d=1$ I could conclude $u=\text{const}$ by the fundamental lemma of calculus of variations. But in general
$$ \int_\Omega u(x) \,  (\partial_{1}\phi_1(x)+...+\partial_d \phi_d(x)) ~d(x_1,...,x_d)=0 \text{ for all } \phi \in W_0^{1,2}(\Omega,\mathbb{R}^d)$$
and I don't know if there is a similar theorem.
 A: As posted by Miskiewicz, one can prove it with a mollification method. That means choosing a ball $B$ such that $\overline{B} \subset \Omega$ and a Dirac sequence $\{ \phi_\epsilon \}_{\epsilon>0}$. Then from $\nabla(q*\phi_\epsilon)=0$ in $B$ we can deduce that $q*\phi_\epsilon$ is constant in $B$. And $q * \phi_\epsilon \to q$ in $L^2(B)$ yields the statement.
Another proof can be done as follows:
Suppose we have a $u\in L^2(\Omega)$ such that $\nabla u=0$ in $W^{-1,2}(\Omega,\mathbb{R}^d)$ hence by definition of the gradient operator
        \begin{equation*}
  \int_{\Omega} u \text{div} \zeta  \text{ d}x=0 \text{ for all } \zeta \in W_0^{1,2}(\Omega,\mathbb{R}^d)
  \end{equation*}
        and for all $\zeta \in W_0^{1,2}(\Omega,\mathbb{R}^d)$
    \begin{equation*}
 \begin{aligned}
 0=\sum_{i=1}^d \int_\Omega u_i \partial_i \zeta_i \text{ d}x  &= \sum_{i=1}^d \langle [u_i], \partial_i \zeta_i \rangle_{W_0^{1,2}(\Omega)} \\ &= - \sum_{i=1}^d \langle \partial_i [u_i],\zeta_i \rangle_{W_0^{1,2}(\Omega)}.
 \end{aligned}
 \end{equation*}
    By choosing successively test functions $\zeta \in C_c^\infty(\Omega,\mathbb{R}^d)$ in which $d-1$ components vanish, we have 
    \begin{equation*}
 \partial_i [u_i] = 0 \text{ in } \mathcal{D}'(\Omega) \text{ for all } i \in \{1,2,...,d\}
 \end{equation*} 
    hence $u_i=constant$ almost everywhere in $\Omega$ as $\Omega$ is connected.
