The residue of $\frac{\cos(\pi z)}{z^2-1} =\frac{h(z)}{z-1}, \ h(z) = \frac{\cos(\pi z)}{z+1}$ at $z = 1$ is $h(1)=\frac{\cos(\pi)}{2} = -1/2$.

The residue of $\frac{\cos(\pi z)}{z^2-1} =\frac{H(z)}{z+1}, H(z) = \frac{\cos(\pi z)}{z-1}$ at $z = -1$ is $H(-1) = 1/2$.

The proof of the residue theorem in the case of finite contours and poles of order $1$ is not complicated :

$g(z) = f(z) - \frac{-1/2}{z-1}- \frac{1/2}{z+1}$ is holomorphic (on a simply connected open containing the contour) so the Cauchy integral theorem applies :
$\int_C g(z)dz =0$

and $$\int_C f(z)dz = \int_C (\frac{-1/2}{z-1}+ \frac{1/2}{z+1})dz = 2i \pi (-1/2+1/2) = 0$$

(for evaluating $\int_C \frac{1}{z-a}dz$, use that when choosing the correct branch for the logarithm : $\frac{d}{dz}\log(z-a) = \frac{1}{z-a}$)