<s>[INST] Find out how many invertible and diagonal solutions $X^2-2X=0 $ has when $ X \in\Bbb{R}^{3\times 3}$ I want to find out how many invertible solutions and how many diagonal solutions matrix equation 
has when 
$ X \in\Bbb{R}^{3\times 3}.$ 
I have researched everywhere and can't seem to find the solution to this problem. I would be very thankful for a lead in the right way.
 [/INST] If $X$ is invertible, then multiplying each side of
$$
  X^2 - 2X = 0
$$
by the inverse of $X$ gives us that
$$
  X - 2I = 0
$$
and so
$$
  X = 2I.
$$
For the case where $X$ is diagonal, let
$$
  X = \begin{pmatrix} a & 0 & 0 \\
                  0 & b & 0 \\
                  0 & 0 & c \end{pmatrix}.
$$
Then we have that
$$
  0 = X^2 - 2x = \begin{pmatrix} a^2 & 0 & 0 \\
                                 0 & b^2 & 0 \\
                                 0 & 0 & c^2 \end{pmatrix}
 - 2 \begin{pmatrix} a & 0 & 0 \\
                     0 & b & 0 \\
                     0 & 0 & c \end{pmatrix}
 = \begin{pmatrix} a^2 - 2a & 0 & 0 \\
                   0 & b^2 - 2b & 0 \\
                   0 & 0 & c^2 - 2c \end{pmatrix}
$$
and so we have a solution if and only if $a^2 - 2a = b^2 - 2b = c^2 - 2c = 0$. This is equivalent to each of $a$, $b$, and $c$ being either $0$ or $2$, and so we see that there are $8$ solutions.
</s>