The Second Derivative Test

The test

The proof runs through the First Derivative Test. Suppose f′′(c)>0f''(c) > 0. Since f′′f'' is continuous, it stays positive on some open interval around cc, so f′f' is increasing there. Since f′(c)=0f'(c) = 0, f′f' is negative just to the left of cc and positive just to the right. By the First Derivative Test, ff has a relative minimum at cc. When f′′(c)<0f''(c) < 0, the same argument with the signs reversed gives a relative maximum.
Near cc, a graph that's concave up with a horizontal tangent lies above that tangent line: a valley. A graph that's concave down at a horizontal tangent lies below it: a peak.
The test needs f′(c)=0f'(c) = 0. At a critical point where f′(c)f'(c) doesn't exist, f′′(c)f''(c) doesn't exist either, so use the First Derivative Test there.

Classifying critical points

When f″(c) = 0

Each function below has f′(0)=0f'(0) = 0 and f′′(0)=0f''(0) = 0, and the three behave differently at 00.
y = x² + 2cos x: a relative minimum at 0.
y = sin²x − x²: a relative maximum at 0.
y = sin x − x: neither; it decreases through 0.
For x2+2cos⁡xx^2 + 2\cos x, f′′(x)=2−2cos⁡xf''(x) = 2 - 2\cos x is positive on both sides of 00. So f′(x)=2x−2sin⁡xf'(x) = 2x - 2\sin x increases through 00, from negative to positive, and ff has a relative minimum.
For sin⁡2x−x2\sin^2 x - x^2, f′′(x)=−4sin⁡2xf''(x) = -4\sin^2 x is negative on both sides of 00. So f′(x)=sin⁡2x−2xf'(x) = \sin 2x - 2x decreases through 00, and ff has a relative maximum.
For sin⁡x−x\sin x - x, f′(x)=cos⁡x−1f'(x) = \cos x - 1 is negative on both sides of 00, so ff decreases through 00 and has neither.
So when f′′(c)=0f''(c) = 0, go back to the First Derivative Test and find the sign of f′f' on each side of cc.

One critical point

Here's the reason for a minimum. Suppose some dd in II, say with d>cd > c, had f(d)<f(c)f(d) < f(c). By the Extreme Value Theorem, ff has a maximum on [c,d][c, d]. It isn't at dd, where ff is below f(c)f(c). If it were at cc, ff would be constant just to the right of cc, and every point there would be critical. So it's strictly between cc and dd, a second critical point. The case d<cd < c is the same.
The theorem needs exactly one critical point. In Example 1, ff has two, and its relative maximum f(1)=−9f(1) = -9 isn't an absolute maximum on x>0x > 0: f(8)=64−80+8ln⁡8≈0.64f(8) = 64 - 80 + 8\ln 8 \approx 0.64 is larger.