What is the Contour $C$ in Cauchy's Integral Theorem? In the context of inverse Z Transforms, what does it mean for a pole $z_0$ to be inside the contour $C$ in the definition of Cauchy's Integal Theorem:

$$
\frac{1}{2\pi j}\oint_C\frac{f(z)}{z-z_0}dz=
\begin{cases}
      f(z_0)\ \ \ \text{if $z_0$ is inside C}\\
0\ \ \ \ \text{otherwise}
    \end{cases}
$$


For example, getting the inverse Z Transform of $\displaystyle{F(z)=\frac{1}{1-az^{-1}}}$ means
$$
f(n)=\frac{1}{2\pi j}\oint_C\frac{z^{n}}{z-a}dz
$$
For $n≥0$, $f(z)$ has only zeros and no poles inside $C$. Also, the only pole inside $C$ is $z=a$ therefore
$$
f(n)=a^n\ \ \ \ \ \ \ n≥0
$$
For $n<0$, $f(z)$ has an $n^{th}$ order pole inside $C$ so
$$
f(n)=\left.\frac{1}{z-a}\right|_{z=0}+\left.\frac{1}{z}\right|_{z=a}=0\ \ \ \ \ \ n=-1\\ \vdots
$$

The book kept on going about $C$ as a closed path inside $z$-plane without telling how large can it enclose inside the plane. I do not understand what is meant by poles to be inside $C$ as stated earlier or even $C$ itself.
Does the poles inside $C$ have to do anything with the region of convergence (ROC) of $f(z)$? Or rather, what is $C$ in this context?
I do not have much background on complex analysis and to be honest, this is my first encounter with contour integration.
 A: First, note that one usually distinguishes between Cauchy's integral theorem:
$$ \tag{under certain assumptions} \int_C f(z)\,dz = 0 $$
and Cauchy's integral formula:
$$ \tag{under certain assumptions} \frac{1}{2\pi i} \int_C \frac{f(z)}{z-z_0} \,dz = f(z_0) $$
You're using the name of one with the statement of the other.
The integral theorem has a sometimes confusing array of variants that make slightly different assumptions about the curve $C$ relative to the domain of $f$. Many of these variants also generalize to variations of the integral formula, but often the latter is only quoted in the simple case where $C$ is a circle traversed counterclockwise, and $f$ is defined on an open disk that includes the circle $C$. In this case it should hopefully be clear what "inside $C$" means, and the circle can be as large as you want, as long as it fits within the domain of $f$.
A circle could also be considered the "prototypical" case of the integral theorem, but generally one immediately generalizes to the case where $C$ is a Jordan curve -- that is, closed and without any repeated points (except for the shared start and end point). Then the Jordan curve theorem tells us that the curve divides the complex plane into an interior and exterior region, and the integral theorem then holds if only $f$ is differentiable on an open domain that contains all of $C$ and all of its interior.
The integral formula works for the Jordan curve case too, if we make the additional assumption that the curve is traversed in the direction where the interior is to the left of the curve as we walk along it.
There are other variants of the integral theorem that allow certain curves with self-intersections, and/or certain domains with holes. The integral formula carries over to some of these (especially ones based on winding numbers) reasonably easily, and doesn't for some others.


Does the poles inside $C$ have to do anything with the region of convergence (ROC) of $f(z)$?

That question does not make sense -- a function as such does not have a "region of convergence". The closest concept is that a power series that defines a function has a disk of convergence, but if the function we start out with was not defined by a power series to begin with, this concept does not mean anything a priori.
