Given. A linear objective $f(x,y,z)=x+y-z$ on the compact constraint surface $g=x^2+y^2+z^2-1=0$ (the unit sphere, so global extrema are guaranteed).
Find. The global maximum and minimum of $f$ on the sphere.
Approach. Solve $\nabla f=\lambda\nabla g$ with the constraint. Since $f$ is linear, the result reproduces the Cauchy–Schwarz bound $|f|\le\|\nabla f\|$ — a useful independent check.
Set up the Lagrange conditions. $\nabla f=(1,1,-1)$, $\nabla g=(2x,2y,2z)$, so
$$1=2\lambda x,\qquad 1=2\lambda y,\qquad -1=2\lambda z\ \Rightarrow\ x=y=\dfrac{1}{2\lambda},\quad z=-\dfrac{1}{2\lambda}.$$
Apply the constraint. $x^2+y^2+z^2=3\left(\dfrac{1}{2\lambda}\right)^2=1\ \Rightarrow\ \lambda^2=\dfrac34\ \Rightarrow\ \lambda=\pm\dfrac{\sqrt3}{2}$.
Evaluate $f$ at each critical point. $f=x+y-z=\dfrac{3}{2\lambda}$. For $\lambda=\tfrac{\sqrt3}{2}$: $f=\dfrac{3}{\sqrt3}=\sqrt3$, at $\left(\tfrac{1}{\sqrt3},\tfrac{1}{\sqrt3},-\tfrac{1}{\sqrt3}\right)$. For $\lambda=-\tfrac{\sqrt3}{2}$: $f=-\sqrt3$, at $\left(-\tfrac{1}{\sqrt3},-\tfrac{1}{\sqrt3},\tfrac{1}{\sqrt3}\right)$.
Compare (the sphere is compact, so these are the global extrema).
$$f_{\max}=\boxed{\sqrt3}\approx1.732,\qquad f_{\min}=\boxed{-\sqrt3}\approx-1.732$$
(Cross-check via Cauchy–Schwarz: $|f|=|(1,1,-1)\cdot(x,y,z)|\le\|(1,1,-1)\|\cdot\|(x,y,z)\|=\sqrt3\cdot1=\sqrt3$, with equality exactly at these two points — agrees.)