A simple question of a complex integral proof, with integer values I have a question with this proof. Let's see the proof and the result first.

Result: If $
\gamma 
$ is any closed path in $
C_{ \ne 0} 
$ then  $
\frac{1}
{2\pi i}\int\limits_\gamma \frac{dz}{z} \in {\Bbb Z}
$

Proof: Let $f$ be a primitive of $ dz/z $ along $ \gamma $ Then $
\int\limits_\gamma \frac{dz}
z = f\left( b \right) - f\left( a \right)
$
where $[a,b]$ parameterizes $\gamma$ . Since $\gamma(a) = \gamma(b) $, this difference is just the difference between two branches of $\log z$, hence of the form $ 2\pi i n$
I don't understand how it uses the fact that $\gamma(a) = \gamma(b)$.
 A: Everywhere but at $z=0$, the function $z\mapsto\frac{1}{z}$ is holomorphic, so the integral around any closed, piecewise-smooth curve that does not contain the origin will be $0$.
In the diagram below, there are two paths, the orignal path following the red arrows (enclosing the red region), and the additional path following the green arrows (enclosing the green region).

The path integral along the original red path and the path integral along the additional green path cancel each other out along the boundary between the red and green regions (the red path and green path are in opposite directions, so $\mathrm{d}z$ on one path is the negative of $\mathrm{d}z$ on the other at the same point).  Thus, we can combine the two path integrals to make one path integral along the path surrounding the union of the red and green regions. If a function is holomorphic in the green region, then the path integral around the union is the same as the integral around the red region since the integral around the green region is $0$.
In this way, we can modify paths through regions where a function is holomorphic without altering the value of the integral.  However, if there is a point at which a function fails to be holomorphic (a singularity), we have to be careful.

In the diagram above, the point in the middle is a singularity. Suppose we want to extend the path surrounding the red region to contain the blue and green regions.  By the argument above, the integral around all three regions is the sum of the integrals around each.  Assuming the function is holomorphic in the green region, the path integral around the green region is $0$, so the integral around the union of the three regions is the integral around the original red region plus the integral around the blue region.
For the function $z\mapsto\frac{1}{z}$, it is easy to compute that the integral around the origin is $2\pi i$. Thus, extending the path of integration through a region with no singularities does not change the integral (as in the first diagram) and extending the path of integration though the origin increases or decreases the integral by $2\pi i$ (as in the second diagram).  Thus,
$$
\frac{1}{2\pi i}\int_\gamma\frac{\mathrm{d}z}{z}
$$
will be an integer.
A: This proof is a little silly because you cannot define the primitive correctly if you "turn around the pole $z = 0$ more than once", because $f$ will have to be defined many times there. The right way to see this would be the following : your curve $\gamma$ can be continuously deformed into a curve $\tilde\gamma : [0,1] \to \mathbb C$ which is just $\tilde\gamma(t) = e^{2\pi i n t}$ for $t \in [0,1]$. Thus the curve goes around the pole $z = 0$ $n$ times (the sign of $n$ is important), thus since $\frac 1z$ has a pole of order $1$ at $z=0$, the integral computes to $n$.
I don't know if you were looking for something more explicit but that is the way I think about this integral.
What they're actually saying is that if $f(z) = 1/z$ then $F(z) = \int f(z) dz$, the primitive, is $\log z$ but that function $\log$ can only be defined over $\mathbb C$ minus a straight line beginning at $0$ and going to $\infty$. This means that when your curve crosses that line, the value of the integral "jumps" from $0$ to $2 \pi i$, then from $2\pi i$ to $4\pi i$, because the order of the pole is $1$, so you get a multiple of $2\pi i$ everytime you cross that line (and you get a negative multiple if you go in the other direction).
Hope that helps, 
