# Does a contour of local extrema of a function $f : \mathbb{R}^2 \to \mathbb{R}$ need always be smooth?

Consider a smooth function $f : \mathbb{R}^2 \to \mathbb{R}$, I wonder that any contour (curve) in $\mathbb{R}^2$ where every point of it is a local maxima of $f$, need be a smooth curve?

Edit : $f$ need to be smooth.

Edit 2 : By contour I mean curve of nonzero arc length.

Elaboration (after comments by Will and copper.hat)

Let the function be $f(x,y)$. I want the contour to have at every point on it, the $\frac{\partial f}{\partial x} = 0$ and $\frac{\partial^2 f}{\partial x^2} < 0$. Is any such contour which is not smooth possible?

-
 What sort of smoothness do you want on $f$? You could be really obnoxious and let $f$ be the characteristic function of a nonsmooth curve if you make no assumptions. – Zach L. Oct 24 '12 at 3:23 @Zach L. : Sorry, I forgot to mention the actual thing. $f$ is smooth that is $\mathcal{C}^{\infty}$ – Rajesh D Oct 24 '12 at 3:26 What do you mean by 'where every point of it is a local maxima of $f$'? The function $f(x)=-(x_1^2+x_2^2)$ has just one (local) maximum at $(0,0)$, does this constitute a smooth curve? – copper.hat Oct 24 '12 at 4:11 @copper.hat : Thanks for the comment. The curve should be of non zero arc length. – Rajesh D Oct 24 '12 at 4:15

$$f(x,y) = - x^2 y^2 {}{}{}{}{}$$
 What is the contour of maxima which is not smooth for this function? – Rajesh D Oct 24 '12 at 4:34 @RajeshD, the $x$ axis and the $y$ axis. Not smooth at the origin. – Will Jagy Oct 24 '12 at 4:36 But it doesn't have a local maximum at $(0,0)$ – Rajesh D Oct 24 '12 at 4:43 +1 It has local maxima on the axes. – copper.hat Oct 24 '12 at 5:04 @copper.hat The partial derivative with respect to $x$ is $0$at $(0,0)$ and the double partial derivative with respect to $x$ is also $0$ at the origin. Hence it does not have a maximum along the x-axis at the origin. – Rajesh D Oct 24 '12 at 5:22