Suppose we have a smooth function $f$ from $\mathbb R^n\to\mathbb R$ such that $\nabla f(0)=0$, and we want to check if $f$ has a local maximum at $0$ (as opposed to a local min or a saddle point).
For any vector $v$ in $\mathbb R^n$, we can form a function $g_v:\mathbb R\to\mathbb R$ defined by $g_v(x)=f(vx)$. Intuitively, we are looking at the behavior of $f$ along the $v$ direction. If $f$ has a local max at zero, then of course $g_v$ also has a local max at zero. My question is, is the converse true? If the single-variable function $g_v$ has a local max at $0$ for every possible direction $v$, does $f$ also have a local max at $0$?
If the Hessian of $f$ at zero has full rank, then this question is easily answered as yes. By taking $v$ to be in turn each of the eigenvectors of the Hessian, the fact that $g_v$ has a local max means that the corresponding eigenvalues are all negative, and so $f$ has a local max at $0$. But if some of the eigenvalues are $0$, then I'm not sure how to analyze it.
As a first step in a proof, I might think: well, for any fixed direction, there is some radius $r$ such that as long as $v$ is within distance $r$ of the origin, then $f(v)\le f(0)$. But since the $r$ depends on the direction, we can't necessarily find a single $r$ which works for all directions, so that might allow for a counter-example.
As a bonus, if it does hold for smooth functions, what about functions that are merely differentiable? Continuous? Or even all functions?