I have a function $f:[-5,5] \mapsto \mathbb{R}$ that is continuous on $[-5,5]$ and differentiable on $(-5,5)$ except at $0$. I'm trying to find all the local extrema.
I know that $f'$ is $0$ at $-3,-2,4$ and undefined at $0$. The only information I have about $f$ is that $$f(-5)=4, f(-3)=2, f(-2)=4, f(0)=2, f(4)=3, f(5)=1.5$$
I know for these problems the first derivative test is best, but we haven't gone over the first derivative test so I try to sort of "recreate" it here.
My attempt:
By the interior extremum theorem if $f$ attains a $\max$ or $\min$ on $(a,b)$ then $f'(c)=0$.
Thus we will apply this to to $(-5,0)$ and $(0,5)$ to get a list of potential local extrema. (We will also consider $x=0$ and the endpoints $x=-5,5$ since they are could also be a location of local extrema.)
First notice that $\nexists c \in (-5,-3)$ where $f'(c)=0.$ (All the points where $f' = 0$ are already given). This means that within $(-5,-3)$, $f'$ cannot change signs. (If it did then $f'$ would have to be $0$). Then if we apply Mean Value Theorem to $(-5,-3)$ we see that $\exists c \in (-5,-3)$ such that $$f'(c) = \frac{f(-3)-f(-5)}{2}=-1$$ Thus $f'<0$ and must be decreasing. By a similar argument $f$ is increasing on $(-3,-2)$.
Then for $x \in (-3-.5, -3+.5) \space f(x)\geq f(-3)$ This is because for $x \in (-3-.5,-3)$ $f$ is decreasing so $f(-3)\leq f(x)$
And for $x \in (-3, -3+.5)$ f is increasing so $f(-3) \leq f(x).$
Thus $\forall x\in (-3,-.5,-3+.5) \space f(x) \geq f(-3)$ which means $f$ has a local minimum in $x=-3$.
Then we apply the above argument (slight tweak for local maximum) to $(-3,-2)$ and $(-2,0)$ and find that $x=-2$ is a local maximum.
Then similar story for $(-2,0)$ and $(0,4)$, we find $x=0$ is a local minimum.
Then again for $(0,4)$ and $(4,5)$ we find $x=4$ is a local maximum.
Then we can apply a similar argument to the endpoints: $(-5,-3)$. Since $f'<0 x=-5$ is a local maximum and for $(4,5) f'<0$ so its a local minimum.
So in summary local minima: $x=-5,-3,0$ and local maxima: $x=-2,4$
Could someone check if this makes sense? Thanks!