Let $\ A $ be a real matrix of $\ 3 \times 3 $ with the characteristic polynom: $\ p(t) = t^3 + 2t^2 -3t $
Prove: the matrix $\ A^2 + A - 2I $ is similar to $\ D = \begin{bmatrix} 0 & 0 & 0 \\ 0 &4 & 0 \\ 0 & 0 & - 2 \end{bmatrix} $
$\ p(t) = t^3 +2t^2 -3t = t(t^2 + 2t -3) = t(t-1)(t+3) $ then $\ A $ has 3 eigenvalues $\ 0,1,-3 $ and is similar to $\ M = \begin{bmatrix} 1 & 0 & 0 \\ 0 & -3 & 0 \\ 0 & 0 & 0 \end{bmatrix}$
also, $\ A^2 + A -2I = (A + 2I)(A-I) $
I can see that if I place $\ M$ instead so $\ (M+2I)(M-I) = D$ yet this is far from proving.
You have almost finished.
It’s just necessary to prove that if $A\sim M$ then also $q(A)\sim q(M),$ where q(x) is a polynomial: using this with the polynomial $q(x)=x^2+x-2$ you can conclude.
So, let’s prove the property. By hypothesis there exists an invertibile Matrix $N$ such that $A=NMN^{-1}.$ Thanks to this you can say that $A^n=NMN^{-1}\cdots NMN^{-1}$ (n times), which is nothing but $NM^nN^{-1},$ (because the $N^{-1}$ and the $N$ in the middle eliminate each other) so the property is proven for monomials.
Passing from monomials to general polynomials is simple, due to the facts that you only have to group the polynomial between $N$ and $N^{-1}.$