Let $Ω ⊂ \mathbb{R}^n$ be a bounded domain with smooth boundary $∂Ω$, and denote by $\vec{n}$ the outer unit normal to $∂Ω$. Prove that the nonhomogeneous Neumann problem
$$ \begin{cases} ∆u = f & \text{ in }Ω \\ \langle∇u ,\vec{n}\rangle = 0 & \text{ on }∂Ω \\ \end{cases} $$
has a solution only if $\int_Ωf = 0$.
How would I go about doing this? Can anyone help to me understand where to start better?
Assuming the correct regularity on $f$, this is an application of the divergence theorem. Indeed notice that $$\int_{\Omega}f\,dx = \int_{\Omega}\Delta u\, dx = \int_{\partial \Omega}\nabla u \cdot n\, d\mathcal{H}^{N-1} = 0,$$ where the last equality follows from the Neumann condition. This is usually referred to as a compatibility condition.