\(\left(x-1\right)^{x+2}=\left(x-1\right)^{x+4}\)
\(\Rightarrow\left(x-1\right)^{x+4}-\left(x-1\right)^{x+2}=0\)
\(\Rightarrow\left(x-1\right)^{x+2}\left[\left(x-1\right)^2-1\right]=0\)
\(\Rightarrow\left[{}\begin{matrix}\left(x-1\right)^{x+2}=0\\\left(x-1\right)^2-1=0\end{matrix}\right.\)
\(\Rightarrow\left[{}\begin{matrix}\left(x-1\right)^{x+2}=0^{x+2}\\\left(x-1\right)^2=1\end{matrix}\right.\)
\(\Rightarrow\left[{}\begin{matrix}x-1=0\Leftrightarrow x=1\\\left[{}\begin{matrix}x-1=1\\x-1=-1\end{matrix}\right.\end{matrix}\right.\)
\(\Rightarrow\left[{}\begin{matrix}x=1\\\left[{}\begin{matrix}x=2\\x=0\end{matrix}\right.\end{matrix}\right.\)