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 simple 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_\gamma f \left({w}\right) \ \mathrm d w$

where $\gamma$ is any contour starting at $z_0$ and ending at $z$.

By Primitive of Function on Connected Domain, $F$ is a primitive of $f$.

Since $F$ is analytic and $F' = f$, we conclude that $f$ is analytic as well.

Also see
This is the converse of the Cauchy-Goursat Theorem.