Answer
a. $ f(0)=-3$ as a local minimum, $f(-\pi)=1$ and $f(\pi)=1$ as local maxima.
$ f(0)=-3$ absolute minimum and $f(-\pi)=f(\pi)=1$ absolute maximum in the interval.
b. See graph and explanations.
Work Step by Step
a. Step 1. Given the function $f(x)=-2cos(x)-cos^2x, -\pi\leq x\lt\pi$, we have $f'(x)=2sin(x)+2sin(x)cos(x)=2sin(x)(1+cos(x))$.
Step 2. The extrema happen when $f'(x)=0$, undefined, or at endpoints; thus we have $sin(x)=0$ or $cos(x)=-1$ and the critical points within the domain are $x=-\pi, 0, \pi$.
Step 3. We have $f(-\pi)=1, f(0)=-3, f(\pi)=1$. Test signs of $f'(x)$ across critical points $(-\pi)..(-)..(0)..(+)..(\pi)$; thus we have $ f(0)=-3$ as a local minimum, $f(-\pi)=1$ and $f(\pi)=1$ as local maxima.
Step 4. We can identify $ f(0)=-3$ as an absolute minimum and $f(-\pi)=f(\pi)=1$ as an absolute maximum in the interval.
b. See graph. We can see that when $f'\lt0$, $f$ decreases; while when $f'\gt0$, $f$ increases (both with the tangent slopes corresponding to the values of $f'$). When $f'=0$, $f$ will be at extrema with tangent slopes of zero. We can also observe the change of signs in $f'$ on different sides of critical points where $f'=0$.