Take a test function $v$ such that $v=0$ on $\partial \Omega$, multiply both sides by this $v$ and integrate over $\Omega$, we get (I implicitly suppose that all fields and functions are sufficiently regular to apply those operators involved):
$$-\int_{\Omega} (\Delta u) v = \int_{\Omega} fv $$
Now, remember the identity $ \text{div} (v \nabla u )= (\nabla u )(\nabla v) + v \Delta u $ to get:
$$\int_{\Omega} \nabla u \nabla v - \int_{\Omega} \text{div} (v \nabla u ) = \int_{\Omega} fv $$
By Green's theorem we can write (if $\partial \Omega$ is sufficiently regular):
$$ \int_{\Omega} \nabla u \nabla v - \int_{\partial \Omega} (v \nabla u) \cdot \mathbf{n} \, dS = \int_{\Omega} fv $$
Finally, because $v=0$ on $\partial \Omega$ we conclude:
$$ \int_{\Omega} \nabla u \nabla v = \int_{\Omega} fv $$
Note that the identity $\text{div} (f \mathbf{F})= \nabla f \cdot \mathbf{F} + f \text{div} \mathbf{F}$ plays the role of "integration by parts", as Wikipedia states.