Answer
$$ g'(z)= 2z-1.$$
Work Step by Step
For the sake of simplicity, we rewrite $ g(z)$ as follows
$$ g(z)=\frac{(z+2)(z-2)}{(z-1)} \, \frac{(z-1)(z+1)}{z+2}\\
=(z-2)(z+1).$$
Using the product rule, the derivative $ g'(z)$ is given by
$$ g'(z)= (z+1)+(z-2)=2z-1.$$