Find the rank of matrix $A$ if $A^3+A^2+A=0$ 
Let $A \in \mathbb{R}^{n \times n}$, where $n \geq 2$, be a matrix for which $$A^3+A^2+A=0$$ Prove that rank of $A$ is an odd number.


What I've done so far: $A^3+A^2+A=0 \Rightarrow  A(A^2+A+I_n)=0$ , then  $A$ is the solution of $x(x^2+x+1)=0$ that means that $x_1=0 \;,\;x_2=-\frac{1}{\sqrt{2}}+\frac{i\sqrt{3}}{2}\;,\;x_3=-\frac{1}{\sqrt{2}}-\frac{i\sqrt{3}}{2}$ are eigenvalues of $A$ and so $A$ is not invertible , also $A\neq 0$ and lastly $A$ must be diagonalizable since it has 3 different eigenvalues.

Any help on how to continue ?
Thank you in advance !
 A: Consider p(t)=$t^3+t^2+t$. Since p(t) annihilates A, the minimal polynomial of A say m(t) is a factor of $t^3 +t^2 +t$.Hence we get three possible cases.
Case 1: m(t)=t. Hence A=0 matrix. Zero is even.
Case 2: m(t)=$t^2+t+I$ and so characteristic polynomial is $(t^2+t+I)^m$ for some positive integer m and thus rank is even in this case.
Case3: m(t)=$t^3+t^2+t$ In this case apart from the zero eigenvalues the non zero eigenvalues occur in cojugate pairs and hence the rank is even in this case also.
Thus in all three cases rank of A is even.
A: Consider the characteristic polynomial $\chi_A$ of A. Since A is real, $\chi_A$ is real too. We can consider A as a complex matrix. As you proved, A is diagonalisable, and its eigenvaleurs are included in the set $\{0,j,\bar{j}\}$, where $j=-\frac{1}{2}+\frac{i\sqrt{3}}{2}$. So :
$$\chi_A=X^p(X-j)^q(X-\bar{j})^s$$
Rememeber that $\chi_A$ is real. This is only possible when $q=s$. Let's evaluate degrees of both sides, we find $n=p+2q$ so $n-p=2q$.
$p$ is the dimension of the kernel of A, so $n-p$ is the rank of A.
