Let $ f: \mathbb{R}^3 \rightarrow \mathbb{R}$ be a differentiable function. We want to find the global extrema of $f$ subject to constraint $$ g(x, y, z)=x^2+y^2+z^2-R^2 \le 0 $$ i.e. find global extrema of restriction $ f\mid _{\overline{\mathcal{B}}_R\left( \overline{0}\right)} $.
$\overline{\mathcal{B}}_R \left( \overline{0} \right)$ is bounded and closed subset of $ \mathbb{R}^3$ and therefore compact. Function $f\mid _{\overline{\mathcal{B}}_R\left( \overline{0}\right)}$ is continuous on compact set so it has global extrema.
(By some theorem which I haven't seen), $ f\mid _{\overline{\mathcal{B}}_R\left( \overline{0}\right)} $ attains its global extrema either on points where $ \nabla f=\overline{0}$ or at the boundary $ \partial \overline{\mathcal{B}}_R \left( \overline{0} \right) $.
Now suppose that I have checked the points where $\nabla f= \overline{0}$. Then I need to check the boundary. I do that by using Lagrange method subject to constraint $g(x, y, z)=0$ .
I already know that local extrema of $f$ subject to constraint $g(x,y,z)=0$ can be found at points where gradient of Lagrangian function is zero. But the theorem also says that I need to check points where $\nabla g=\overline{0}$ and boundaries of the constraint surface $ g(x, y, z)=0$. So what is the boundary to check on sphere $ g(x, y, z)=0$ and what guarantees that (if it doesn't have any boundaries to check) extrema are on local extrema of $f$ subject to $g(x, y, z)=0$?