Prove $\nabla \cdot f=0$ knowing $\int_{R^3}f \cdot \nabla \phi\ dxdydz=0$ for $\phi$ with compact support I want to prove that:
If $f$ is continuously differentiable vector field from $\mathbb{R}^3 \to \mathbb{R}^3$, and for any continuously differentiable function $\phi:\mathbb{R}^3 \to \mathbb{R}$ with compact support, we have:
$$
\int_{R^3}f \cdot \nabla \phi\ dxdydz=0
$$
Then $\nabla \cdot f=0$.
Firstly, I want to use the identity that $\nabla \cdot (f\phi) = f \cdot \nabla \phi + \phi \nabla \cdot f$ but I don't know how to proceed.
My second idea is make $\phi$ to be a small ball surrounding a point and using Gauss's theorem. To be specific, let $r$ be a radius and let $\lambda(x,y,z)=\frac{1}{2r}(x^2+y^2+z^2)$, then $\|\nabla\lambda\| = 1$ on the sphere $x^2+y^2+z^2 = r^2$. 
Then let $\phi=\lambda$ when $x^2+y^2+z^2 = a^2$ and $a\in(r-\frac{1}{2}\Delta r, r+\frac{1}{2}\Delta r)$ where $\Delta r>0$ is a small number, and $\phi=0$ elsewhere. Here $\phi$ is not differentiable and this is where my concern is. To continue my idea, notice that $\nabla\phi$ is the norm vector over the ball. Then I guess $\frac{\int_{R^3}f \cdot \nabla \phi\ dV}{\Delta r} \approx \int_{R^3}f \cdot \nabla \phi\ dS$. We can use Gauss's theorem:
$$
\int_{R^3}f \cdot \nabla \phi\ dS = \int_{R^3}f \cdot dS = \int_{R^3}\nabla \cdot f\ dV=0
$$
Since $f$ is continuously differentiable, $\nabla \cdot f(0,0,0)$ should be $0$. 
This is only my intuitive way and there are many flaws in it. Could anyone help me? Thank you!
 A: Let  $\mathbf{x} \in \mathbb{R}^3$ be any point and $B_\delta(\mathbf{x})$ be the open ball of radius $\delta$ centered at $\mathbf{x}$. 
Using the identity $\nabla \cdot (\phi \, f) = \phi \, \nabla \cdot f +  f \cdot\nabla\phi $ and applying the divergence theorem, we have
$$\int_{B_\delta(\mathbf{x})} \phi \, \nabla \cdot f \, dV = \int_{B_\delta(\mathbf{x})}  \nabla \cdot (\phi \, f) \, dV - \int_{B_\delta(\mathbf{x})}  f \cdot\nabla\phi \, dV = \int_{\partial {B_\delta(\mathbf{x})} } \phi \cdot \mathbf{n}  \, dS - \int_{B_\delta(\mathbf{x})}  f \cdot\nabla\phi \, dV.$$
If $\phi$ has compact support inside $B_\delta(\mathbf{x})$ then the first integral on the RHS vanishes since $\left.\phi \right|_{\partial B_\delta(\mathbf{x})}=0$ and the second integral vanishes by hypothesis
Thus, for any continuously differentiable function $\phi$ with compact support inside the open ball, 
$$\int_{B_\delta(\mathbf{x})} \phi \, \nabla \cdot f \, dV = 0$$
Since $\nabla \cdot f$ is continuous, if $\nabla \cdot f(\mathbf{x}) > 0$ then there exists an open ball $B' \subset B_\delta(\mathbf{x})$ such that $\nabla \cdot f > 0$ throughout $B'$.
We can choose $\phi$ such that $\phi \, \nabla \cdot f (\mathbf{x}) \geqslant  0$ in $B_\delta(\mathbf{x})$ and it follows that
$$0 < \int_{B'} \phi \, \nabla \cdot f \, dV  \leqslant \int_{B_\delta(\mathbf{x})} \phi \, \nabla \cdot f \, dV = 0.$$
a contradiction. A similar argument applies if $\nabla \cdot f (\mathbf{x}) < 0$.
Thus, $\nabla \cdot f = 0$ on $\mathbb{R}^3$.
