Compute the expectation directly. In the continuous case,
\begin{align*}
\mathbb{E}_\theta[\nabla_\theta \log f(X, \theta)] &= \int_{\mathcal{X}} \nabla_\theta \log f(x, \theta)\, f(x, \theta)\, dx \\
&= \int_{\mathcal{X}} \frac{\nabla_\theta f(x, \theta)}{f(x, \theta)}\, f(x, \theta)\, dx \\
&= \int_{\mathcal{X}} \nabla_\theta f(x, \theta)\, dx \\
&= \nabla_\theta \int_{\mathcal{X}} f(x, \theta)\, dx = \nabla_\theta 1 = 0.
\end{align*}
The penultimate step exchanges differentiation and integration, which is justified by the assumed regularity of the model. The final step uses the fact that $\int_{\mathcal{X}} f(x, \theta)\, dx = 1$ for all $\theta \in \Theta$ since $f(\,\cdot\,, \theta)$ is a density. The discrete case is identical with sums replacing integrals.