Let $f$ be a distribution on $\mathbf{R}^n$ (in the Schwartz sense) such that $$\frac{\partial f}{\partial x_i} = 0 \text{ for $i = 1, \ldots, n$.}$$
Then how to prove that $f$ is a constant? I had this exercise in a class last year but I couldn't find how to do the induction step (for $n = 1$ it is clear of course).
For $\partial f/\partial x_i$ to vanish, then $f$ has to vanish on the space of test functions of the form $\partial \phi_i/\partial x_i$. You effectively need to show the subspace spanned by all of these (as $i$ varies) is of codimension one in $C^{\infty}_c(\mathbb{R}^n)$. This subspace has to be the space of all test functions integrating to zero. To go from $n-1$ to $n$, take a test function $\phi$ with integral $0$ and let $\psi(x_1,\ldots,x_{n-1})=\int\phi(x_1,\ldots,x_n)dx_n$. Then $\psi$ is a test function on $\mathbb{R}^{n-1}$ with integral $0$ so is a sum of functions $\partial \psi_i/\partial x_i$ where the $\psi_i$ are test functions on $\mathbb{R}^{n-1}$. Extend to test functions $\phi_i$ on $\mathbb{R}^n$ by letting $\phi_i(x_1,\ldots,x_n) =\psi_i(x_1,\ldots,x_{n-1})h(x_n)$ where $h$ is a fixed bump function with integral $1$. Then $\phi-\sum\partial\phi_i/\partial x_i$ has zero integral along all lines in the $x_n$-direction, so is the $x_n$-partial derivative of a test function.
Added I should add that the above is effectively the proof that $H_c^n(\mathbb{R}^n)=\mathbb{R}$ where $H_c^*$ denotes de Rham cohomology with compact supports.