The distance between a point [tex](x,y,z)[/tex] and the origin is [tex]\sqrt{x^2+y^2+z^2}[/tex]. But since [tex](\sqrt{f(x)})'=\frac{f'(x)}{2\sqrt{f(x)}}[/tex], both [tex]f(x)[/tex] and [tex]\sqrt{f(x)}[/tex] have the same critical points, so we can consider instead the squared distance, [tex]x^2+y^2+z^2[/tex].
We're looking for the extrema of [tex]x^2+y^2+z^2[/tex] subject to [tex]x+y+2z=12[/tex] and [tex]z=x^2+y^2[/tex]. The Lagrangian is
[tex]L(x,y,z,\lambda,\mu)=x^2+y^2+z^2+\lambda(x+y+2z-12)+\mu(z-x^2-y^2)[/tex]
with critical points where the partial derivatives vanish:
[tex]L_x=2x+\lambda-2\mu x=0\implies\lambda=2x(\mu-1)[/tex]
[tex]L_y=2y+\lambda-2\mu y=0\implies\lambda=2y(\mu-1)[/tex]
[tex]L_z=2z+2\lambda+\mu=0[/tex]
[tex]L_\lambda=x+y+2z-12=0[/tex]
[tex]L_\mu=z-x^2-y^2=0[/tex]
From the first two equations, it follows that [tex]x=y[/tex].
Then in the last two equations,
[tex]x+y+2z-12=0\implies x+z=6[/tex]
[tex]z-x^2-y^2=0\implies z=2x^2[/tex]
[tex]\implies x+2x^2=6\implies2x^2+x-6=(2x-3)(x+2)=0\implies x=\dfrac32\text{ or }x=-2[/tex]
If [tex]x=\frac32[/tex], then [tex]z=6-\frac32=\frac92[/tex]; if [tex]x=-2[/tex], then [tex]z=8[/tex].
So there are two critical points, [tex]\left(\frac32,\frac32,\frac92\right)[/tex] and [tex](-2,-2,8)[/tex].
Let [tex]f(x,y,z)=\sqrt{x^2+y^2+z^2}[/tex]. We have a minimum distance of [tex]f\left(\frac32,\frac32,\frac92\right)=\boxed{\frac{3\sqrt{11}}2}[/tex] and maximum distance of [tex]f(-2,-2,8)=\boxed{6\sqrt2}[/tex].