\(M=x^2+y^2-xy+x+y+1\)
\(\Rightarrow2M=2x^2+2y^2-2xy+2x+2y+2\)
\(=\left(x^2-2xy+y^2\right)+\left(x^2+2x+1\right)+\left(y^2+2y+1\right)\)
\(=\left(x-y\right)^2+\left(x+1\right)^2+\left(y+1\right)^2\ge0\)
Vì \(2M\ge0\)\(\Rightarrow M\ge0\)
=> GTNN của M =0 khi \(\left\{{}\begin{matrix}x-y=0\\x+1=0\\y+1=0\end{matrix}\right.\)
\(\Leftrightarrow x=y=-1\)