Thanks again for Martin's new extension
What a great extension! But I still need to check $\int_{\alpha}^{\beta}w(s)ds=\int_{\gamma}\frac{1}{z-a}dz$ . The integrands are different only at "several" points. Done! Wow, I'm extremely grateful for his help. Ahlfors' Complex Analysis is a masterpiece without doubt. But sometimes it is not friendly to self-learners. Maybe we can write an elaborated notes which will benefit all the future self-learners.
Thanks for Martin's answer. But it leads to some more essential questions.
According to Martin's answer, I get:
$h(t)=\int_{t_{k-1}}^{t}\frac{z^{\prime}(t)}{z(t)-a}dt, t\in[t_{k-1},t_{k}), k=1,2,3,\cdots,n$ and $h(t_{n})=\int_{t_{n-1}}^{t_{n}}\frac{z^{\prime}(t)}{z(t)-a}dt$.
$h(t)$ is discontinuous at $t_{1},t_{2},\cdots,t_{n-1}$.
We have $h^{\prime}(t)=z^{\prime}(t)/(z(t)-a), t\in(t_{k-1},t_{k}), k=1,2,\cdots,n$.
$h^{\prime}(t)$ is not defined at $t_{1},t_{2},\cdots,t_{n-1}$.
But Ahlfors states “since this function(this function means $e^{-h(t)}(z(t)-a)) $ is continous (on $[t_0,t_n]$) it must reduce to a constant”. I think this statement is not true since $h(t)$ is discontinuous at $t_{1},t_{2},\cdots,t_{n-1}$ and $h^{\prime}(t)$ is not defined at $t_{1},t_{2},\cdots,t_{n-1}$! I'm confused!
My orignal question: mistakes in proving $\int_{\gamma}\frac{dz}{z-a}=2k\pi i$ in Ahlfors' Complex Analysis
On the third edition of Ahlfors' Complex Analysis, page 115 Lemma 1 it states: If the piecewise differentiable closed curve $\gamma$ does not pass through the point $a$, then the value of the integral $\int_{\gamma}\frac{dz}{z-a}$ is a multiple of $2\pi i$.
Then, he tries to prove this lemma. He says: If the equation of $\gamma$ is $z=z(t)$, $\alpha\leq t\leq \beta$, let us consider the function $h(t)=\int_\alpha^t \frac{z^\prime (t)}{z(t)-a}dt$. It is defined and continuous on the closed interval $[\alpha,\beta]$, ...
Here are my questions:
First, I think, in the lemma, the condition "differentiable" is not strong enough. $\gamma$ should be "continuously differentiable".
Second, I think $z^{\prime}(t)$ doesn't even exist at some $t\in[\alpha,\beta ]$ (as a resutl, $h(t)$ is not well defined), since $\gamma$ is "piecewise" continuously differentiable. For example, let $\gamma$ be line segments from the point $(0,0)$ to $(1,0)$, from $(1,0)$ to $(1,1)$, from $(1,1)$ to $(0,1)$, and then goes back to the point $(0,0)$. We set $z(t)=x(t)+iy(t), 0\leq t\leq 4$ for the curve $\gamma$. Then, we set $x(t)=t, 0\leq t\leq1$ and $x(t)=1,1\leq t \leq 2$. $x^\prime(t)$ doesn't exist when $t=1$. Finally, $z^\prime(t)$ doesn't exist when $t=1$.
I show you the whole context below. I don't know how to modify Ahlfors' proof to fix this "mistake".

Ahlfors defines an “arc” as a continuous function from an interval $[\alpha, \beta] \to \Bbb C$, this is in 2.1 Arcs and Closed Curves. on pages 67-68 in my edition of Complex Analysis. Ahlfors then defines
and later
In other words, a function $z: [\alpha, \beta] \to \Bbb C$ is a piecewise differentiable arc (in the sense of Ahlfors) if $z$ is continuous, and if there is a partition $$ \alpha = t_0 < t_1 < \cdots < t_n = \beta $$ so that the restriction of $z$ to the interval $[t_{k-1}, t_k]$ is continuously differentiable for every $1 \le k \le n$.
Now consider the function $$ w(t) = \frac{z'(t)}{z(t) - a} \, . $$ $w$ is not defined at the points $t_k$, but has left and right limits at these points. We can assign arbitrary values to $w(t_k)$, then $w: [\alpha, \beta] \to \Bbb C$ is integrable, so that $$ h(t) = \int_\alpha^t w(s) \, ds $$ is continuous. Also $h'(t) = w(t)$ at all points where $w$ is continuous, that is everywhere on $[\alpha, \beta]$ except possibly at the points $t_k$.
Conclusion: Yes, you are right, the continuity of the derivative (or some similar condition) is needed to apply the fundamental theorem of calculus. But that is implicitly given due to the way Ahlfors defines piecewise differentiable curves.