Let $A$ be an $n*n$ matrix such that $A^3=A^2+A-I$. If $A$ Is diagonalizable Show that $A=A^{-1}$

Hint If $\lambda$ is an eigenvalue, then $$\lambda^3-\lambda^2-\lambda+1=0 \Rightarrow (\lambda-1)^2(\lambda+1)=0 \Rightarrow \lambda=\pm 1$$

What is then $D^2$?

Therefore $$A^2=PD^2P^{-1}=??$$


Suppose $A$ is a diagonalizable, and write $A=PDP^{-1}$. Then the equation becomes $PD^3P^{-1}=PD^2P^{-1}+PDP^{-1}-I$, which when we multiply by $P^{-1}$ on the left and $P$ on the right, we see is equivalent to $D^3=D^2+D-I$. Thus it suffices to show the diagonal case.

Let $D$ have diagonal entries $\lambda_i$ ($1\leq i\leq n$). Then for each $i$ we have the equation $\lambda_i^3-\lambda_i^2-\lambda_i+1=0$ (since entries of diagonal matrices are multiplied directly), which is equivalent to $(\lambda_i+1)(\lambda_i-1)^2=0$. Now, find $\lambda_i$ to solve for $D$ and hence $D^{-1}$. I think you can take it from here.