\(f\left(x\right)=x\left(x+1\right)\left(x-1\right)\left(x+2\right)-24\)
\(=\left(x^2+x\right)\left(x^2+x-2\right)-24\)
\(=\left(x^2+x\right)^2-2\left(x^2+x\right)-24\)
\(=\left(x^2+x-6\right)\left(x^2+x+4\right)\)
\(f\left(x\right)=0\Leftrightarrow\left(x^2+x-6\right)\left(x^2+x+4\right)=0\)
\(\Leftrightarrow\left[{}\begin{matrix}x^2+x-6=0\\x^2+x+4=0\left(vn\right)\end{matrix}\right.\) \(\Rightarrow\left[{}\begin{matrix}x=2\\x=-3\end{matrix}\right.\)