This is similar to Green's theorem. In fact, both proofs start by subdividing the region into a finite number of squares, like a high resolution checkerboard. The squares are small, so that the contour is practically a straight line as it passes through any one of these squares. The integrals along the borders of adjacent squares cancel out, hence the sum of the integrals around all these little subregions produces the contour integral around p(t). You may want to review Green's theorem for a more detailed explanation of this process.
The path is well behaved in each square that it cuts through, but we may have to make the grid finer still. Select a small real number ε and build the checkerboard to the following specifications.
Consider the jth square, or partial square, if it is cut by the contour. Select a point zj in this square, such that the difference quotient f(z)-f(zj) over z-zj is always within ε of f′(zj), for all z in the jth square. If a square has such a point it is good, else it is bad.
Look at all the squares in the grid and divide each into four subsquares. In other words, the grid is twice as fine as it was before. If the squares had side s, they now have side s/2.
Leave the good squares alone. Thus a good square spawns four new good squares. Reevaluate the smaller bad squares. Some of them just might turn good.
Repeat this process, cutting squares into subsquares and reevaluating the bad ones, until finally the entire region is good. Can this be done? Does the process terminate? Is there a grid where everything is good? Suppose there isn't and see what happens.
Suppose the process continues forever. At the nth step, find a square that is bad, and let pn be any point in this square (or partial square, if the contour cuts through the square). This builds an infinite set of points inside the region, which is a closed bounded set in the plane. Let q be a cluster point of this set. In other words, the points of p approach q. Since the complex numbers form a complete metric space, and since the contour and its interior form a closed set, q is also on or inside the contour. Thus f is analytic at q, with f′(q) = r. Find δ so that the difference quotient, based at q, is within ε of r. Then cut δ in half, just to be safe. When the squares shrink below δ in size, The square or squares containing q (q might be on the border) are all good, thanks to q. Now q is in the interior of a region that is good, and remains good thereafter. The points in our sequence cannot approach q, and we have produced a contradiction. Therefore the process terminates, and there is a grid where all the squares are good.
Cover the region with good squares, and remember, all these squares are not the same size. When a square is first labeled good, we cut it into subsquares for illustrative purposes only, so we could talk about a uniform grid. Actually the good squares should never be cut at all. So the size of a good square depends on when it was first marked good. Some good squares are large and some are small, the latter being discovered late in the process. If the smallest good square has a side of length s, every other good square has a side of length s times a power of 2.
There are finitely many good squares, and we can arrange them in a list. Largest to smallest, smallest to largest, left to right, it doesn't matter.
For the jth square in the list, define the function ej(z) as follows.
e(z) = (f(z)-f(zj))/(z-zj) - f′(zj)
Setting e(zj) = 0 makes this function continuous within its square.
Turn things around and solve for f.
f(z) = f(zj) + (z-zj)×f′(zj) + (z-zj)×e(z)
Evaluate the contour integral of f by integrating the three terms on the right. The contour integral of a constant, or z times a constant, is 0, thanks to the previous theorem, so the first two terms drop out. That leaves (z-zj)×e(z). Evaluate the entire contour integral Of f by adding up the integrals of (z-zj)×e(z) for each square.
By construction, |e()| < ε. If the square has a side of length s, then |z-zj| is no more than sqrt(2)s. And the perimeter is 4s. The integral around the square is no larger than 4×sqrt(2)×s2×ε. (This is not quite right if the contour cuts the square, but we'll get to that in a minute.) Thus the contour integral is some constant times ε times the area of the square. If the area of the region is a, the sum of the individual contour integrals is bounded by a×ε times some constant. Make ε as small as we like, and the contour integral is held arbitrarily close to 0. Hence the integral equals zero, after we clean up the partial squares below.
Consider a square that is cut by the contour. At this resolution, the path looks like a straight line, so a nearly straight line cuts through our square, creating a small poligonal region. The perimeter of this region is certainly smaller than 4s+l, where l is the length of the arc passing through the square. How do we know this arc has a length? Because the derivative of the path, and hence its speed, is piecewise continuous, and continuous on a closed interval implies bounded. So the speed is bounded, and arc length is the integral of speed, hence the contour has a well defined length. The same holds for a closed section of the contour that cuts through a given square. Therefore l is well defined.
Add l×sqrt(2)×s×ε to the previous contour integral. Set s to the side of the squares in the first grid, before we started marking squares good or bad. Then add up the terms, so that l is replaced with the length of the entire contour. The result is an expression that is a constant times ε. Let ε approach 0 and this expression approaches 0. Therefore the entire contour integral of f is 0.
If f is analytic in a simply connected domain, the integral of f around any closed contour in the domain is 0. Draw the contour, note that f is analytic on and inside this curve, and apply the Cauchy Goursat theorem.
A variant of this theorem applies when the domain is not simply connected. Assume f is analytic on an annulus about 0, with outer radius r and inner radius s. (Note that f may not be analytic at 0.) Draw a line segment l, through the annulus, connecting the inner and outer circles. Let p(t) run around the outer circle in a counterclockwise direction, then along l to the inner circle, then around the inner circle in a clockwise direction, than back along l to its starting point. We will be taking the contour integral of f along p. The two integrals along l, back and forth, cancel, leaving the integrals around the two circles, running in opposite directions. The total integral is still 0, hence the integral of f along the outer circle equals the integral of f along the inner circle. This result holds for any two simple closed curves, where one is wholly inside the other, and f is analytic throughoutt the region bounded by these two curves.