Here is Artin's proof:
First we need to prove a lemma.
Lemma: Let $\gamma$ be a path in an open set $U$. There there exists a rectangular path $\eta$ with the same end points, and such that $\gamma,\eta$ are close together in $U$. In particular, $\gamma$ and $\eta$ are homologous in $U$, and for any holomorphic function $f$ on $U$ we have
$$
\int_{\gamma}f=\int_{\eta}f.
$$
Definition: We say that $\gamma,\eta$ are close together if there exists a partition
$$
a = a_0\leq a_1\leq\cdots\leq a_n=b,
$$
and for each $i=0,\ldots, n-1$ there exists a disc $D_i$ contained in $U$ such that the images of each segment $[a_i,a_{i+1}]$ under the two paths are contained in $D_i$.
Proof of Lemma:
Suppose $\gamma$ is defined on the interval $[a,b]$. Partition the interval as $a = a_0\leq a_1\leq\cdots\leq a_n=b$ such that the image $\gamma[a_i,a_{i+1}]$ is contained in a disc $D_i$ on which $f$ has a primitive (see image).
Thus $\gamma,\eta$ are homologous since they can be deformed into each other so $\int_{\gamma}f=\int_{\eta}f$.
The lemma reduces the proof of Cauchy's theorem to $\gamma$ a rectangular closed chain. Let $\gamma_i:[a_i,a_{i+1}]\to U$ be the restriction of $\gamma$ to the smaller interval. Then the chain is $\gamma_1+\cdots+\gamma_n$ a subdivision of $\gamma$. If $\eta_i$ is obtained from $\gamma_i$ by another parametrization, we have the chain $\eta_1+\cdots+\eta_n$ which is a subdivision of $\gamma$. The chains $\gamma$ and $\eta$ do not differ from each other. If $\gamma = \sum m_i\gamma_i$ is a chain and $\{\eta_{ij}\}$ is a subdivision, we call
$$
\sum_i\sum_jm_in_{ij}
$$
a subdivision of $\gamma$. Next we need to prove the following theorem.
Theorem: Let $\gamma$ be a rectangular closed chain in $U$, and assume that $\gamma$ is homologous to $0$ in $U$; that is, $W(\gamma,\alpha)=0$ for every point $\alpha$ not in $U$. Then there exist rectangles $R_1,\ldots,R_n$ contained in $U$, such that if $\partial R_i$ is the boundary of $R_i$ oriented counterclockwise, then a subdivision of $\gamma$ is equal to
$$
\sum_i^nm_i\partial R_i
$$
for some integers $m_i$. Note $W(\gamma,\alpha)=0$ is the winding number.
Proof of Theorem:
Given the rectangle chain $\gamma$, we draw all vertical and horizontal lines passing through the sides of the chain. The lines decompose the plane into rectangles, and rectangular regions extending to infinity in the vertical and horizontal directions. Let $R_i$ be one of the rectangles, and let $\alpha_i$ be a point inside $R_i$. Let $W(\gamma,\alpha_i)=m_i$. For some rectangles we have $m_i=0$, and for some, we have $m_i\neq 0$. Let $R_i,\ldots, R_N$ be the rectangles whose $m_i\neq 0$. Let $\partial R_i$ be the boundaries of these rectangles for $i=1,\ldots,N$ oriented counterclockwise.
- Every rectangle $R_i$ such that $m_i\neq 0$ is contained in $U$.
- Some subdivision of $\gamma$ is equal to $\sum_i^Nm\partial R_i$.
Assertion $1$. By assumption, $\alpha_i$ must be in $U$, becuase $W(\gamma,\alpha)=0$ for all $\alpha$ outside of $U$. The winding number is constant on connected sets so it is constant on the interior of $\partial R_i\subset U$ and not equal to zero. If the boundary points of $R_i$ are on $\gamma$, then it is in $U$. If not on $\gamma$, then the winding number is defined and equal to $m_i\neq 0$. Thus $R_i\subset U$.
Assertion $2$. Replace $\gamma$ by an appropriate subdivision. We can find a subdivision $\eta$ such that every curve occurring in $\eta$ is some side of a rectangle or the finite side of an infinite rectangular region. The subdivision $\eta$ is the sum of the sides taken with appropriate multiplicity. If a finite side of an infinite rectangle occurs in the subdivision, after inserting one more horizontal or vertical line, we may assume that this side is also the side of a finite rectangle. WLOG, we may assume that every side of the subdivision is also of one of the finite rectangles in the gird formed by horizontal and vertical lines.
Suppose $\eta-\sum m_i\partial R_i$ is not the $0$ chain. Then it contains some horizontal or vertical segment $\sigma$, so that we can write
$$
\eta-\sum m_i\partial R_i = m\sigma + C,
$$
where $m$ is an integer, and $C$ is a chain of vertical or horizontal segments other than $\sigma$. Then $\sigma$ is the side of a finite rectangle $R_k$. We take $\sigma$ with the orientation arising from the counterclockwise orientation of the boundary of the rectangle $R_k$. Then the closed chain
$$
C=\eta-\sum m_i\partial R_i-m\partial R_k
$$
does not contain $\sigma$. Let $\alpha_k$ be a point interior to $R_k$, and let $\alpha'$ be a point near $\sigma$ but on the opposite side from $\alpha_k$.
Since $\eta-\sum m_i\partial R_i-m\partial R_k$ does not contain $\sigma$, the points $\alpha_k$ and $\alpha'$ are connected by a line segment which does not intersect $C$. Therefore, $W(C,\alpha_k)=W(C,\alpha')$. But $W(\eta,\alpha_n)=m_k$ and $W(\partial R_i,\alpha_k)=0$ unless $i=k$ in which case $W(\partial R_k,\alpha_k)=1$. Similarly, if $\alpha'$ is inside some finite rectangle $R_j$ so $\alpha'=\alpha_j$, we have
$$
W(\partial R_k,\alpha_j)=\begin{cases}
0, & \text{if }j\neq k\\
1, & \text{if }j=k
\end{cases}
$$
If $\alpha'$ is in an infinite rectangle, then $W(\partial R_k,\alpha')=0$. Hence
\begin{alignat}{2}
W(C,\alpha_k)&=W\Bigl(\eta-\sum m_i\partial R_i-m\partial R_k,\alpha_k\Bigr) &&= m_k-m_k-m &&= -m\\
W(C,\alpha')&=W\Bigl(\eta-\sum m_i\partial R_i-m\partial R_k,\alpha'\Bigr)&&=0
\end{alignat}
Thus, $m=0$ and $\eta-\sum m_i\partial R_i=0$. Suppose $C\neq 0$. Then
$$
C=m\sigma+C^*
$$
where $\sigma$ is a horizontal or vertical segment, $m$ is an integer not equal to zero, and $C^*$ is a chain of vertical or horizontal segments other than $\sigma$. Then $\sigma$ is the side of a finite rectangle. We take $\sigma$ with the counterclockwise orientation of the boundary rectangle $R$. the the chain $C-m\partial R$ does not contain $\sigma$. let $\alpha$ be a point inside of $R$, and let $\alpha'$ be a point near $\sigma$ but on the opposite side from $\alpha$. Then we can join $\alpha$ to $alpha'$ by a segment which does not intersect $C-m\partial R$. By continuity and connectedness of the segment, we have
$$
W(C-m\partial R,\alpha)=W(C-m\partial R,\alpha')
$$
but $W(m\partial R,\alpha)=m$ and $W(m\partial R, \alpha')=0$. Thus $W(C,\alpha)=W(C,\alpha')=0$ so $m=0$.
By the lemma and theorem, we know that for any holomorphic function $f$ on $U$, we have
$$
\int_{\partial R_i}f =0
$$
by Goursat's theorem. Hence, the integral of $f$ over $\gamma$ is also equal to $0$.
The conclusion of a theorem may fail if one of its hypotheses fails. In this case, if either
- the domain is not simply-connected, or
- the function is not holomorphic, or
- the path is not closed
the integral may be nonzero. However, there is nothing that says it has to be nonzero, even if all 1-2-3 fail together. This is what fedja commented on:
If any condition or a set of conditions fail, it doesn't yet mean that the conclusion fails. It is the same as my phrase "If it is raining, I carry an umbrella with me" does not imply that if it is not raining, I don't (maybe it is sunny but I am just carrying the umbrella to a repair shop, or for whatever other reason). Most mathematical theorems are also one way (If ..., then...). When it is a two way theorem, it normally starts with "The following are equivalent:" or some other explicit phrase with the same meaning.
If you are looking for a set of conditions to guarantee that the integral is nonzero, here is one: $f$ is holomorphic except for one simple pole, and $\gamma$ is a simple closed curve that separates the pole from the boundary of the domain of $f$. This is just a consequence of the Residue theorem.
But if the path $\gamma$ is not locally rectifiable, there is no obvious meaning of $\int_\gamma f$ at all. In this case the statement fails simply because we lack a definition of the integral over such path.
Best Answer
(1) No it does not have to have a primitive. Take $\frac{1}{x}$ on $\mathbb{R}\setminus \{0\}$, it does not have a primitive function.
(2) In fundamental theorem of calculus you assume that function has a primitive function. But in Cauchy's integral theorem you have no idea about existance of primitive function.
In CIT you really need simply connected region. There is strong geometrical connection between existence of primitive function and the region. (http://en.wikipedia.org/wiki/Closed_and_exact_differential_forms)