Local Maxima

If a function f(x) is continuous on an interval (a,b) and it has two local maximums on (a,b), then it must have a local minimum on (a,b). A similar result for functions of two or more variables is not true. A simple example is provided by the function

f |\x, y/| = 3 - |\x2- 1/|2- |\x2y - x - 1/|2.
The only critical points of this function are the points
x = 1,  y = 2
x = -1,   y = 0.
Both of these points are local maxima by the second derivative test for functions of two variables. The graph of this function is shown below with the red points indicating the two local maxima.