Solution (source code)

= Solution

For $f=x^2+y^2+z^2$ and $g=x^2+2y^2-z^2=1$, the <Lagrange multiplier> equations are
$$
(1-\lambda)x=0,\qquad(1-2\lambda)y=0,\qquad(1+\lambda)z=0.
$$
The four constrained stationary points are
$$
\boxed{(\pm1,0,0),\qquad(0,\pm1/\sqrt2,0).}
$$
On the constraint, $f=2x^2+3y^2-1$ with $x^2+2y^2\geq1$. The two $y$-axis points are global minima, while the $x$-axis points are saddles: motion along the waist decreases $f$, whereas motion away from it increases $f$. There is no maximum.

If instead $g=x^2+2y^2-z^2$ is optimized on $x^2+y^2+z^2=1$, the stationary points are all six coordinate-axis points. The $y$-axis points are maxima with value $2$, the $z$-axis points are minima with value $-1$, and the $x$-axis points are saddles with value $1$.