Show that there are an infinite number of solutions to $X^3 = I_2$ in $M_2(\mathbb{Q})$.
$\operatorname{det} (X) = 1$ because $X^3 = I_2$ and $\operatorname{det} (X) \in \mathbb{Q}$
$X^2 = X^{-1}$ and, using Cayley-Hamilton $X^2 = \operatorname{tr}(X) X - I_2$ so $$ X^{-1} = \operatorname{tr}(X)X - I_2 $$ but when i try to solve this equation the solution it gives do not verify $X^3 = I_2$. What am I doing wrong?
Any matrices with characteristic polynomial $\lambda^2+\lambda+1$ will do: both eigenvalues satisfy $\lambda^3=1$. For example, for any integer $n$ one can take
$$ X=\left[ \begin{array}{rrr} n, & -1-n-n^2\\ 1, & -1-n \end{array}\right]. $$