Proof of Cauchy Integral Formula for annulus Suppose that $f$ is holomorphic in a neighborhood of $A_{r,R}=\{z\in \mathbb C: r<|z|<R\}$, then $f(z) = \frac{1}{2\pi i}\oint_{c_{R}}\frac{f(w)}{z-w}dw-\frac{1}{2\pi i}\oint_{c_{r}}\frac{f(w)}{z-w}dw$. This is the CIT formula for annulus.
I was told to prove it like this:
Fix $z \in A_{r,R}$, using the CIT for star shaped region for the function $g(w)=\frac{f(w)-f(Z)}{w-z}$ if $w \neq z$ and $g(w) = f'(w)$ if $w=z$, I can argue that $\frac{1}{2\pi i}\oint_{c_{R}}\frac{f(w)-z}{z-w}dw-\frac{1}{2\pi i}\oint_{c_{r}}\frac{f(w)-z}{z-w}dw =0$ as pictured below
But then $2\pi if(z)$ will be cancelled, what is wrong with this argument?
 A: The integral around the drawn curve vanishes. You may then let the vertical segments approach and they will cancel. The integral then becomes (with $\gamma$ being the boundary of the annulus, oriented in the opposite direction of your drawing):
$$ 0= \oint_\gamma \frac{f(w)-f(z)}{w-z} \frac{dw}{2\pi i} = \oint_\gamma \frac{f(w)}{w-z} \frac{dw}{2\pi i} - f(z)$$
A: Try to relate your corridor contour with the usual  proof :


*

*If $g(z)$ is holomorphic on $U = \{r-\epsilon < |z| < R+\epsilon\}$ then $$\int_{|z| = R} g(z)dz = \int_{|z| = r} g(z)dz$$
This a special case of the Cauchy integral theorem (if $g(z)$ is holomorphic on $U$ and a closed contour $\gamma$ is homotopically equivalent to $\gamma'$ on $U$, then $\int_\gamma g(z)dz = \int_{\gamma'} g(z)dz $)

*Apply it to $g(z)  =\frac{f(z)-f(a)}{z-a}$ where $a \in U$ (*) so that $\int_{|z| = R} \frac{f(z)-f(a)}{z-a}dz -\int_{|z| = r} \frac{f(z)-f(a)}{z-a}dz = 0$

*Finally, show that $$\int_{|z| = R} \frac{1}{z-a}dz -\int_{|z| = r} \frac{1}{z-a}dz = \int_{|z| = R} \frac{1}{z-a}dz = 2i \pi$$
So that
$$\int_{|z| = R} \frac{f(z)}{z-a}dz - \int_{|z| = r} \frac{f(z)}{z-a}dz$$ 
$$ = \int_{|z| = R} \frac{f(z)-f(a)}{z-a}dz - \int_{|z| = r} \frac{f(z)-f(a)}{z-a}dz+f(a) \left(\int_{|z| = R} \frac{1}{z-a}dz - \int_{|z| = r} \frac{1}{z-a}dz\right)$$
$$ = 2i \pi f(a)$$
(*) $g(z)$ is holomorphic around $z= a$ because $f(z)$ is analytic, but if you didn't prove that holomorphic $\implies$ analytic yet, use the Cauchy integral theorem to show  that $\int_{|z| = R} \frac{f(z)-f(a)}{z-a}dz -\int_{|z| = r} \frac{f(z)-f(a)}{z-a}dz = \lim_{\epsilon \to 0} \int_{|z-a|=\epsilon} \frac{f(z)-f(a)}{z-a}dz =  0$
