Morera's Theorem

Theorem
Let $D$ be a simply connected domain in $\C$.

Let $f: D \to \C$ be a continuous function.

If, for every simply closed contour $\gamma$ in $D$:


 * $\displaystyle \int_\gamma f \left({z}\right) \ \mathrm d z = 0$

then $f$ is analytic on $D$.

Proof
For a fixed $z_0\in D$ and $z\in D$ we consider the function:


 * $\displaystyle F \left({z}\right) = \int_{z_0}^z f \left({w}\right) \ \mathrm d w$

Because the integration over any simply closed contour in $D$ is equal to $0$, the integral only depends on the starting and ending point of any path.

Thus, it follows that the above integral is well defined.

It is sufficient to use the General Form of Cauchy's Integral Formula:


 * $\displaystyle f^{(k)}(z)=\frac{k!}{2\pi i}\int_{\gamma}\frac{f(\epsilon)}{(\epsilon -z)^{k+1}}d\epsilon$

for any $z$ in the interior of $\gamma$, by definition of the integral we have $F' = f$, and we conclude that $f$ is analytic on $D$.

Also see
This is the converse of Cauchy's Integral Theorem.