\(\Delta'=4-\left(m+1\right)\ge0\Rightarrow m\le3\)
Theo Viet: \(\left\{{}\begin{matrix}x_1+x_2=4\\x_1x_2=m+1\end{matrix}\right.\)
\(x_1^2+x_2^2=4\left(x_1+x_2\right)\)
\(\Leftrightarrow\left(x_1+x_2\right)^2-2x_1x_2-4\left(x_1+x_2\right)=0\)
\(\Leftrightarrow16-2\left(m+1\right)-16=0\)
\(\Leftrightarrow m+1=0\Rightarrow m=-1\)