Morera's theorem How can I prove Morera's theorem?

Morera's Theorem: If a function $f(z)$ is continuous in a simply connected region and its integration over a closed path gives $0$, then the function is analytic.

 A: Morera´s theorem states:Let the function 
$f: \mathbb{C} \longrightarrow \mathbb{C}$. be continuous in a simply connected open set S. If  $$\oint_Cf(z)dz=0$$ for a simple closed path $C$ that lies on $S$ then $f$ is an analytic function in $S$
Let $z_0$ in $S$ and define for all $z$ in $S$
$$F(z)=\int_{z_0}^{z} f(z)dz$$ Look that $F(z)$ do not depend on the path of the curve between the integration intervals, so the function  $F(z)$ is well defined. Now we need to prove that $F(z)$ is differentiable at any point $z$ in $S$, such that it derivative is $f$, by definition, $F$ and all its derivatives are analytic over $S$. now let $h$ be a complex number such that $z+h$ is in $S$, then $$\dfrac{F(z+h)-F(z)}{h}=\dfrac{1}{h}\int_{z}^{z+h} f(y)dy$$, note now that $f(z)$ is in terms of the variable $y$, so $$|\dfrac{F(z+h)-F(z)}{h}-f(z)|=|\dfrac{1}{h}\int_{z}^{z+h}(f(y)-f(z))dy|$$
The integration variable $y$ lies on the path defined by the last integral, so if $h$ tends to 0, $y$ tends to $z$ by basic complex analysis.Now , how $f$ is continuous at $z$: $f(y)$ tends to $f(z)$ as $y$ tends to $z$, so here you use epsilon, delta definition and show that
$$\lim_{h\to0}{\dfrac{F(z+h)-F(z)}{h}}=f(z)$$
A: Let $D$ be a simply connected region.
We fix a point $p$ of $D$.
Let $z \in D$.
Consider $g(z) = \int_{p}^{z} f(\zeta) d\zeta$, where the integral path is any piece-wise smooth curve starting from $p$ and ending at $z$.
Then, by the assumption, $g(z)$ is uniquely determined.
Since $g'(z) = f(z)$, $g(z)$ is holomorphic on $D$.
Hence $f(z)$ is holomorphic on $D$.
A: Statement of theorem is incorrect: the line integral of f(z) around C must be 0 for every closed curve c contained in S , otherwise F(z) as defined above might be path dependent and the proof invalid
