Let $f: U \subset \mathbb{C}$ be analytic and $\gamma_1, \gamma_2$ be two arbitrary closed paths. Prove that:
$ \int_{\gamma} f(z) \ dz = 0$ for any closed path $ \iff\int_{\gamma_1} f(z) \ dz = \int_{\gamma_2} f(z) \ dz $.
It's easy to see the $\implies$ direction, but I'm having a harder time with the other.
I am assuming that the question actually is: to prove that $\displaystyle\int_\gamma f(z)\,\mathrm dz=0$ for any closed path if and only if for any two paths $\gamma_1$ and $\gamma_2$ with the same initial points and the same final points, $\displaystyle\int_{\gamma_1}f(z)\,\mathrm dz=\int_{\gamma_2}f(z)\,\mathrm dz$.
If the second condition holds, let $\gamma$ be a closed path. And let $\gamma^\star\colon[0,1]\longrightarrow\mathbb C$ be the constant path such that $\gamma^\star(t)$ is equal to the initial (and final) point of $\gamma$. Then$$\int_\gamma f(z)\,\mathrm dz=\int_{\gamma^*}f(z)\,\mathrm dz=0.$$