This is my own solution to the following problem:
Let $A\in \mathcal{M}_n(\mathbb{R})$ be a matrix such that $\mathrm{Tr(A)=0}$ and $A^3-A^2-A-2I_n = 0$. I want to show that there exists $p \in \mathbb{N}$ such that $n=5p$ and that $A$ is similar to :
$$C=\begin{pmatrix} 2I_p & 0 & 0 & 0 \\ 0 & B & 0 & 0 \\ 0 & 0 & \ddots & 0 \\ 0 & 0 & 0 & B \end{pmatrix}$$
where $B = \begin{pmatrix} 0 & -1 \\ 1 & -1 \end{pmatrix}$
First of all, $P(X) = X^3-X^2-X-2$ annulates $A$ and one can see that:
$$P(X) = (X-2)(X^2+X+1) = (X-2)(X-j)(X-\bar{j})$$
where $j = \mathrm{e}^{i2 \pi/3}$.
Therefore as $P$ annulates $A$ and is irreducible with all its factors of degree $1$ and all of its roots with multiplicity equals to one thus I know $A$ is diagonalizable on $\mathbb{C}$.
Moreover, we know that $\sigma(A) \subset\{2,j,\bar{j}\}$ as $P$ annulates $A$.
Therefore, there exists $a,b,c \in\mathbb{N}$ such that its characteristic polynomial $\chi_A$ can be written:
$$\chi_A(X) = (X-2)^a(X-j)^b(X-\overline{j})^c$$
But $\chi_A \in \mathbb{R}[X]$ because $A$ is a matrix with real coefficients. Consequently $\chi_A = \overline{\chi_A}$ so $b = c$.
Moreover $\mathrm{Tr}(A) = 2a+bj+c\bar{j} = 2a+b(j+\overline{j})=2a-b=0 $, so $2a = b$. Finally $a+b+c = a+2b= \deg(\chi_A) = n$, we deduce that $\boxed{5a =n}$.
Therefore,
$$\chi_A(X) = (X-2)^{a}(X-j)^{2a}(X-\bar{j})^{2a}$$
As $a \neq 0$ we have $\sigma(A) = \{2,j,\bar{j}\} $ and because $A$ is diagonalizable on $\mathbb{C}$ there exists $P \in GL_n(\mathbb{C})$ such that,
$$A = P\begin{pmatrix}
2I_a & 0 & 0 & 0 & 0 & 0 \\
0 & j & 0 & 0 & 0 & 0 \\
0 & 0 & \bar{j} & 0 & 0 & 0 \\
0 & 0 & 0 & \ddots & 0 & 0 \\
0 & 0 & 0 & 0 & j & 0 \\
0 & 0 & 0 & 0 & 0 & \bar{j}
\end{pmatrix} P^{-1}$$
On top of that if we call $B = \begin{pmatrix} 0 & -1 \\ 1 & -1 \end{pmatrix}$ we have $\chi_B(X)= X^2+X+1 = (X-j)(X-\bar{j})$, thus because $j \neq \overline{j}$ we can find $Q \in GL_2(\mathbb{C})$ such that,
$$ B = Q \begin{pmatrix} j & 0 \\ 0 & \overline{j} \end{pmatrix} Q^{-1} $$
Hence,
$$C =
\begin{pmatrix} I_a & 0 & 0 & 0 \\ 0 & Q & 0 & 0 \\ 0 & 0 & \ddots & 0 \\ 0 & 0 & 0 & Q \end{pmatrix}
\begin{pmatrix}
2I_a & 0 & 0 & 0 & 0 & 0 \\
0 & j & 0 & 0 & 0 & 0 \\
0 & 0 & \bar{j} & 0 & 0 & 0 \\
0 & 0 & 0 & \ddots & 0 & 0 \\
0 & 0 & 0 & 0 & j & 0 \\
0 & 0 & 0 & 0 & 0 & \bar{j}
\end{pmatrix}
\begin{pmatrix} I_a & 0 & 0 & 0 \\ 0 & Q & 0 & 0 \\ 0 & 0 & \ddots & 0 \\ 0 & 0 & 0 & Q \end{pmatrix}^{-1}$$
Consequently, $A$ is similar to the real matrix $C$ in $\mathcal{M}_n(\mathbb{C})$ so we can write $A = RCR^{-1}$ with $R = R_1 +iR_2\in GL_n(\mathbb{C})$ and $R_1,R_2 \in \mathcal{M}_n(\mathbb{R})$
Hence $AR = RC$, then $ AR_1 = R_1C$ and $AR_2 = CR_2$.
Moreover $\varphi : x \mapsto \det(R_1+xR_2) $ is a polynomial function with real coefficients and we know $\varphi(i) = \det(R) \neq 0$ therefore $\varphi$ has a finite number of roots, meaning we can find $x_0 \in \mathbb{R}$ such that $\varphi(x_0) \neq0$, id est $R_0 = R_1+x_0R_2 \in GL_2(\mathbb{R})$ and :
$$AR_0 = AR_1+x_0AR_2 = R_1C +x_0R_2C = R_0C$$
Finally,
$$A = R_0 C R_0^{-1}$$
So it proves that $A$ is similar to $C$ in $\mathcal{M}_n(\mathbb{R})$.