Given. Objective $f(x,y,z)=x+y-z$; constraint $g=x^2+y^2+z^2-1=0$ (the unit sphere, compact).
Find. The maximum and minimum values of $f$ on the sphere.
Approach. The unit sphere is closed and bounded, so $f$ attains both extrema on it. Apply Lagrange multipliers: $\nabla f=\lambda\nabla g$ together with the constraint gives exactly two critical points.
Substitute into the constraint.
$$x^2+y^2+z^2=\frac{3}{4\lambda^2}=1\ \Rightarrow\ \lambda^2=\frac34\ \Rightarrow\ \lambda=\pm\frac{\sqrt3}{2}.$$
Evaluate $f$ at both critical points. $f=x+y-z=\dfrac{3}{2\lambda}$. For $\lambda=+\tfrac{\sqrt3}{2}$: $f=\sqrt3$ (maximum, at $(x,y,z)=(\tfrac{1}{\sqrt3},\tfrac{1}{\sqrt3},-\tfrac{1}{\sqrt3})$). For $\lambda=-\tfrac{\sqrt3}{2}$: $f=-\sqrt3$ (minimum, at the antipodal point).