I have actually two questions here, but both are very much related so I decided to put them both in this question.
From Wikipedia I found the following example of a function that has a single critical point which is a local minimum, yet is not a global minimum:
$f(x,y) = x^2 + y^2(1-x)^3$
Indeed the only critical point of $f$ is $(0,0)$ which is a local minimum by the second derivative test, but $(0,0)$ is not a global minimum because $f(4,1) = -11$. Why does this happen? I am having some trouble understanding intuitively why this is true. I know that $f$ has a minimum when restricted to a compact set. Then $(0,0)$ is a global minimum in any closed ball around $(0,0)$, and thus $(0,0)$ is a global maximum?? This is not true because $f$ is a counterexample, but I can't quite understand why.
In some cases we do have a global minimum at the unique critical point. For example, let
$f(x,y) = (-x+y)^2 + (x-1)^2 + (x+y-1)^2$
Then $f$ has a unique critical point at $(\frac{2}{3}, \frac{1}{6})$. The critical point turns out to be a global minimum (according to the graph and wolframalpha). How would I prove that the point is a global minimum? And how does one in general decide that a function has a global minimum/maximum on a critical point when the function is defined on all of $\mathbb{R}^2$, particularly when there is only one critical point?