Theo bài ta có: \(\left\{{}\begin{matrix}f\left(x\right)=x^2-x-2\\f\left(x\right)=0\end{matrix}\right.\)
\(\Rightarrow x^2-x-2=0\)
\(\Rightarrow x^2-2x+x-2=0\)
\(\Rightarrow x\left(x-2\right)+\left(x-2\right)=0\)
\(\Rightarrow\left(x+1\right)\left(x-2\right)=0\)
\(\Rightarrow\left[{}\begin{matrix}x+1=0\\x-2=0\end{matrix}\right.\)\(\Rightarrow\left[{}\begin{matrix}x=-1\\x=2\end{matrix}\right.\)