Given $\vec F = \nabla f$ and f is a smooth function from $\mathbb{R}^3$ to $\mathbb{R}$. And, $$\iiint_B f(\nabla \cdot \vec F) \,dV = \iint_{\partial B} (f\vec F) \cdot d\vec S $$ where $B$ is any open ball and $\partial B$ oriented with outward normal.
How can I prove $f$ is a constant function? Where should I start?
Using Gauß's theorem, we have $$ \int_{\partial B} fF\cdot n \, dS = \int_B \nabla \cdot (fF)\, dV $$ Note, that $$ \nabla \cdot (fF) = \nabla f \cdot F + f \nabla \cdot F $$ Hence, $$ \int_B \nabla f \cdot F \, dV = 0 $$ As $F = \nabla f$, we have $$ \int_B |\nabla f|^2\, dV = 0. $$ As $f$ is smooth, $\nabla f$ is continuous, hence the above implies (since $|\nabla f|^2 \ge 0$), that $\nabla f = 0$. Hence, $f$ is constant.