Answer
a. $f(-\pi/4)=\frac{\pi}{2}-1$ local maximum, $ f(\pi/4)=1-\frac{\pi}{2}$ local minimum.
No absolute maximum or absolute minimum.
b. See graph and explanations.
Work Step by Step
a. Step 1. Given the function $f(x)=-2x+tan(x), -\pi/2\leq x\lt\pi/2$, we have $f'(x)=-2+sec^2(x)$.
Step 2. The extrema happen when $f'(x)=0$, undefined, or at endpoints; thus we have $sec^2(x)=2, sec(x)=\pm\sqrt 2$ and the critical points within the domain are $x=-\pi/4, \pi/4$.
Step 3. We have $ f(-\pi/4)=-2(-\pi/4)+tan(-\pi/4)=\frac{\pi}{2}-1, f(\pi/4)=-2(\pi/4)+tan(\pi/4)=1-\frac{\pi}{2}$. Test signs of $f'(x)$ across critical points $.. (+)..(-\pi/4)..(-)..(\pi/4)..(+)..$; thus we have$f(-\pi/4)=\frac{\pi}{2}-1$ as a local maximum, $ f(\pi/4)=1-\frac{\pi}{2}$ as a local minimum.
Step 4. There are no absolute maximums or absolute minimums because as $x\to\pm\pi/2, f(x)\to\pm\infty$
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 an 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$.