Suppose we are working on a Riemann Surface $X$, assume of genus g $\geq$ 1. Let $\omega$ be a holomorphic 1-form on $X$, with
$$ \textrm{Re} \int_\gamma \omega = 0$$
for every closed contour $\gamma$, so integration between two points is path-independent.
Now if for all $p,q \in X$ we have that
$$ \textrm{Re} \int_p^q \omega = 0$$
Can we conclude that $\omega = 0$?
My first thought of solving was to write $\omega = f(z)dz$ with $f$ a holomorphic function on $X$, but that didn't help me any further. Since only the real part is zero, most standard theorems don't seem to help.
A holomorphic $1$-form is closed, hence locally exact, $\omega = dF$ for a holomorphic $F$ in an open set $U\subset X$ which we may assume connected. If
$$\operatorname{Re} \int_p^q \omega = 0$$
for all $p,q\in X$, that means that the real part of the local primitive $F$ is constant, hence $F$ is constant, and $\omega = dF = 0$ in $U$. By the identity theorem (or local primitives in other open sets), we have $\omega \equiv 0$ on all of $X$.