Intuition behind the residue at infinity [duplicate]
Solution 1:
The thing is that functions do not have residues, but rather differentials have residues. This is something which can be quite confusing in a first complex analysis class. The "residue of a function" is not invariant under a change of local parameter, but the residue of a differential is. For this reason, what is usually called the "residue at $0$ of $f(z)$" is actually the residue at $0$ of $f(z)dz$.
When you change the coordinate from $z$ to $w=1/z$, the differential $dz$ is transformed into $-dw/w^2$, which explains the change of sign and the extra factor. Thus,
$$f(z)dz = \frac{-1}{w^2} f(1/w) dw.$$
The "residue of $f$ at $\infty$" is the residue at $0$ of $\frac{-1}{w^2} f(1/w) dw$.
Solution 2:
$-1/z^2$ comes from changing the variable from $z$ to $u=1/z$.
So $$ \int_{C_0} f(z)dz=\int_{C'} f(1/u)d(1/u)=-\int_{C'}\frac{-1}{u^2}f(1/u)du $$
where $C'$ is the trace of $C_0$ in the $u$ space. If all singularity lies within $C_0$ in the $z$ space, then every singularity (except for the one at $u=0$) of $-(1/u^2)f(1/u) $ would lie outside the $C'$ in the $u$ space.
Since $u=0$ is the only singular point of $-(1/u^2)f(1/u)$ inside $C'$, thus this integral gives the residue at $u=0$, or equivalently, $z=\infty$.