I am having a weird Lagrange multiplier problem here. I have functions $f$ and $g$, defined by $f(x,y) = xy$ and $g(x,y) = (1-x^2)^2+(1-y^2)^2$, and I want to minimize $f$ over $\{(x,y) : g(x,y) = 0\}$. It is clear that the minimizers are $(1,-1)$ and $(-1,1)$. However, let us do Lagrange. We have $\nabla f = (y,x)$ and $\nabla g = 4((1-x^2)x,(1-y^2)y)$. And here is the problem. On $\{g=0\}$ we have $\nabla g = 0$. Thus, Lagrange gives us $\nabla f = 0$, which means $(x,y) = (0,0)$, which is not in the set $\{g=0\}$.
Why does the Lagrange method fail here?
The main statement behind Lagrange multipliers is that to extremize $f$ subject to $g=0$, the gradient of $f$ should be orthogonal to the set $\{ \mathbf{x} : g(\mathbf{x})=0 \}$. This means that you can't increase/decrease the value of $f$ without either going "far away" from the current point or changing the value of $g$. This orthogonality is really defined as the gradient of $f$ being orthogonal to the tangent plane* of $g$.
This tangent plane only makes sense if the level set of $g$ is at least one-dimensional. In this case the orthogonality condition is equivalent to $\nabla f$ and $\nabla g$ being parallel, since $\nabla g$ is already orthogonal to the tangent plane of $g$. When we assume that the level set of $g$ is at least one-dimensional, this parallel condition can be written as $\nabla f = \lambda \nabla g$, the usual form taught in calculus classes.
When the level set of $g$ is zero-dimensional, technically the Lagrange condition is still correct (even though its derivation is now nonsensical). However, you have to write "$\nabla f$ and $\nabla g$ are parallel" as $\lambda \nabla f = \nabla g$ instead, because in this case $\nabla g=0$ and so $\lambda=0$ satisfies the property.
In this problem the bottom level sets of $g$ consist of just points (namely the points satisfying the two equations $|x|=1,|y|=1$), which is why this is coming up.
* I say plane but it isn't always a plane; the more general term is "tangent space" but I don't want you to go look up this term and become confused at all the differential geometry that you find.