Let $f$ be an analytic function in the neighbourhood of the spectrum $\sigma(A)$ of a bounded operator $A$. Let $C$ be a contour, counterclockwise around $\sigma(A)$ within the domain of $f$. Finally let $f(A)$ be defined by
$$f(A)=\dfrac{1}{2\pi i}\oint_C f(z) (z-A)^{-1}dz.$$
Now I have to prove that $(fg)(A)=f(A)g(A)$ but I don't know how to start. I do recognize Cauchy's integral and since $f$ is analytic on a neighbourhood of $\sigma(A)$ one could use Cauchy's integral formula but I don't see how this would help.
Let $C'$ be a slightly larger boundary curve within which both $f$ and $g$ are holomorphic. By the holomorphic functional calculus, \begin{align*} f(A)&=\frac{1}{2\pi i}\int\limits_{C}f(\zeta)(\zeta-A)^{-1}\, d\zeta\\ g(A)&=\frac{1}{2\pi i}\int\limits_{C'}g(z)(z-A)^{-1}\, dz. \end{align*} Then (after swapping the order of integration), we get the double integral $$f(A)g(A)=-\frac{1}{4\pi^2}\int\limits_{C'}\int\limits_{C}f(\zeta)g(z)(\zeta-A)^{-1}(z-A)^{-1}\, d\zeta dz.$$ Recall the resolvent identity $$(\zeta-z)(\zeta-A)^{-1}(z-A)^{-1}=(z-A)^{-1}-(\zeta-A)^{-1}.$$ Plugging this into the integral,
$$f(A)g(A)=-\frac{1}{4\pi^2}\int\limits_{C'}\int\limits_{C}f(\zeta)g(z)(\zeta-z)^{-1}\left((z-A)^{-1}-(\zeta-A)^{-1}\right)\, d\zeta dz.$$ If you integrate the $(z-A)^{-1}$ piece in $\zeta$, you get an integral of $0$, by Cauchy's theorem (which is why it helps to take a slightly larger boundary curve). So, this term vanishes, and we only need to look at the $(\zeta-A)^{-1}$ term. Notice that this can be simplified a lot by doing the $z$ integral first using the Cauchy integral formula $$g(\zeta)=\frac{1}{2\pi i}\int\limits_{C'}\frac{g(z)}{z-\zeta}\, dz.$$ Thus,
$$f(A)g(A)=\frac{1}{2\pi i}\int\limits_{C} f(\zeta)g(\zeta)(\zeta-A)^{-1}\, d\zeta=(fg)(A).$$