\(x+y+z=6\Rightarrow\left(x+y+z\right)^2=36\)
\(\Rightarrow x^2+y^2+z^2+2\left(xy+xz+yz\right)=36\)
\(\Rightarrow xy+xz+yz=12\)
\(\Rightarrow x^2+y^2+z^2=xy+xz+yz\)
\(\Rightarrow2x^2+2y^2+2z^2-2xy-2xz-2yz=0\)
\(\Rightarrow\left(x-y\right)^2+\left(x-z\right)^2+\left(y-z\right)^2=0\)
\(\Rightarrow\left\{{}\begin{matrix}x-y=0\\x-z=0\\y-z=0\end{matrix}\right.\) \(\Rightarrow x=y=z\)
Mà \(x+y+z=6\Rightarrow x=y=z=2\)