Single-variable calculus from first principles
Once you've found a critical point (where f′ = 0), there's a fast way to tell whether it's a peak or a valley, faster than checking signs on both sides. Just look at the concavity there, using the second derivative.
The logic is simple. At a flat spot, if the curve cups upward (concave up), you must be at the bottom of a bowl, a minimum. If it caps downward (concave down), you're at the top of a dome, a maximum.
Imagine setting a marble down on a flat spot of a curved surface, then pouring a little water. A bowl holds the water and cradles the marble at the bottom, that's a minimum, cupping upward. A dome sheds the water and lets the marble roll off the top, that's a maximum, capping downward. The second derivative simply tells you which shape you're standing on.