A professor gave me the following statement:If $g$ is analytic on $D$ and $\int_{\beta}g(z)\, dz=0$ for any piece-wise simple smooth closed curve (let $z_0$ be a fixed point) and define $G(z)=\int_{\beta}g(z)\, dz$ where $\beta$ is any curve from $z_0$ to $z$. Then, $$\mbox{1) $G$ is well-defined and analytic.}$$ $$\mbox{2) $G'=g$.}$$
Is it true and if and is so can I get an example of how to apply it?