Proving theorem connecting the inverse of a holomorphic function to a contour integral of the function. I am asked to prove this theorem:
If $f:U \rightarrow C$ is holomorphic in $U$ and invertible, $P\in U$ and if $D(P,r)$ is a sufficently small disc about P, then 
$$f^{-1}(w) = \frac{1}{2\pi i} \oint_{\partial D(P,r)}{\frac{sf'(s)}{f(s)-w}}ds$$   
The book says to "imitate the proof of the argument principle" but I am not seeing the connection.
 A: Hint: Since $f$ is holomorphic and invertible, for each $w\in f(D(P,r))$, $f(z)-w$ has a unique zero $f^{-1}(w):=z_0$ in $U$; moreover, $z_0\in D(P,r)$. Therefore, $f(z)=w+(z-z_0)h(z)$ on $U$, where $h$ is holomorphic and has no zero on $U$.
A: I had a similar problem:


*

*$f(z)$ has local inverse $f^{-1}(w) = z$. Write down an integral formula that gives $f^{-1}(w)$ in terms of $f(z)$. 


My solution:


*

*Apply Cauchy Integral formula: Since $f^{-1}(w)$ is analytic by the inverse function theorem, we can say:


$$f^{-1}(w) = \frac{1}{2\pi i }\oint_{f(\partial D(P,r))}\frac{f^{-1}(u)}{u-w}du$$
2. Using Substitution: $u=f(z)$ for $z$ on $\partial D(P,r) \implies du = f'(z)dz$ 
3.Rewrite:    $$f^{-1}(w) = \frac{1}{2\pi i }\oint_{\partial D(P,r)}\frac{zf'(z)}{f(z)-w}dz$$
A: After some thought, it makes sense after applying the Cauchy Integral Formula to the inverse function and then making the substitution $ f^{-1}(s) = t $ where t is taken along the path given by $f^{-1}(s)$ where s is along $\partial D(P,r)$.
The problem is being able to deform that curve into a circle which goes around $f^{-1}(w)$. This can be done if we can show the path only goes around $f^{-1}(w)$ once.
I still have no idea how the argument principle is involved
A: The answer by J_Lopez8 gives a motivation (and a proof) for the "mysterious" formula. But knowing the formula, you can prove it using residue theory.
As $f'\ne 0$ in a nhood of $P$, for $r$ small enough the integrand has at most a simple pole in $f^{−1}(w)$ with residue
$$
{\rm Res}_{s=f^{-1}(w)}{\frac{sf'(s)}{f(s) - w}} = \lim_{s\to f^{-1}(w)}(s - f^{-1}(w))\frac{sf'(s)}{f(s) - w}
 = \lim_{s\to f^{-1}(w)}\frac{{sf'(s)}}{\frac{f(s) - f(f^{-1}(w))}{s - f^{-1}(w)}}
  = \frac{f^{-1}(w)f'(f^{-1}(w))}{f'(f^{-1}(w))} = f^{-1}(w).
$$
For an alternative proof (Complex Functions by Goodstein, 8.2.8), use the following theorem:
Let be $f:D\longrightarrow{\Bbb C}$ holomorphic in the simply connected open set $D$, $\gamma\subset D$ a simple closed curve, $f'(z)\ne 0$ for all $z\in\gamma$. If $f$ has a only simple pole (has only a pole and is simple) $z_0$ in the interior of $\gamma$, then
$$z_0 = \frac1{2\pi i}\int_\gamma\frac{z f'(z)}{f(z)}\,dz.$$
