We have $f(z)=\dfrac{1}{\sin(z)}$ in $z = k\pi , k = 0 , \pm 1 , \pm 2 , \dots$
I used the formula: $Res(f/g, a)=\dfrac{f(a)}{g'(a)}$
Then
$Res(f, k\pi)= \dfrac{1}{\cos(k\pi)}=(-1)^k$.
is correct?
We have $f(z)=\dfrac{1}{\sin(z)}$ in $z = k\pi , k = 0 , \pm 1 , \pm 2 , \dots$
I used the formula: $Res(f/g, a)=\dfrac{f(a)}{g'(a)}$
Then
$Res(f, k\pi)= \dfrac{1}{\cos(k\pi)}=(-1)^k$.
is correct?
Answer for earlier version: what you have calculated is the residue of $\frac 1 f$ at $k\pi$. $f$ itself has no poles so residue of $f$ at any point is $0$. Answer for new version: yes, your calculation is correct.