If $A^2-2A=0$, then $p(A)=0$, for $p(x)=x^2-2x$, and thus the minimal polynomial of $A$ can by only one of the following three: $$ x^2-2x,\,\,\, x\,\,\, \text{or}\,\,\, x-2, $$ each of which possesses only simple roots, and thus $A$ is diagonalisable.

In general, if a matrix is annihilated by a polynomial which does not have any multiple roots, then this matrix is diagonalisable.

If you are not aware of the above fact, try Jordan decomposition, and see that $A$ can not have any Jordan blocks, in its Jordan decomposition.

Note. This proof works only in the case in which $0\ne 2$ in the field $\mathbb F$. If $2=0$ in $\mathbb F$, then the polynomial $p$ becomes $p(x)=x^2$, in such case the condition $A^2=0$, does not guarantee that $A$ is diagonalizable. In fact, there exist non-diagonalizable matrices satisfying $A^2=0$.


As stated (notably without any restriction on the field*) the result is false. In characteristic $2$, every nilpotent matrix of nilpotency order$~2$ satisfies $A^2=2A$, but such matrices are not diagonalisable. See also this answer to a rather similar question.

*except that it must be denotable using a blackboard-bold font


Let me try to prove it in a more elementary way:

We define the eigenspaces $$ X_0=\{x\in\mathbb F^n: Ax=0\} \,\,\,\text{and}\,\,\, X_2=\{x\in\mathbb F^n: Ax=2x\}. $$ We shall show that $\mathbb F^n=X_0\oplus X_2$.

Clearly $X_0\cap X_2=\{0\}$.

Let $x\in\mathbb F^n$, $x_2=\frac{1}{2}Ax$ and $x_0=x-x_2$. Then $$ Ax_0=Ax-Ax_2=Ax-\frac{1}{2}A^2x=\frac{1}{2}(A^2-A)x=0, $$ and $$ Ax_2-2x_2=\frac{1}{2}A^2x-2\cdot\frac{1}{2}Ax=\frac{1}{2}(A^2-2A)x=0. $$

Let $\{b_1,\ldots, b_k\}$ a basis of $X_0$ and $\{b_{k+1},\ldots,b_n\}$ a basis of $X_2$ and $U$ be the matrix with columns $b_1,\ldots,b_n$. Then $UAU^{-1}$ is diagonal.

Note that we need to assume that $2\ne 0$ in $\mathbb F$ (for example, $\mathbb F\ne\mathbb Z_2$).


Suppose that $Ax = \lambda x$, $x \neq 0$.

$Ax = \lambda x \Leftrightarrow 2Ax=2\lambda x \Leftrightarrow A^2x = 2\lambda x \Leftrightarrow A(Ax) = 2\lambda x \Leftrightarrow A(\lambda x) = 2 \lambda x \Leftrightarrow \lambda Ax = 2 \lambda x $. That means that either $\lambda = 0$, or $Ax = 2 x$, which means that $0$ and $2$ are the only eigenvalues of $A$.

Suppose it's not diagonalizable. Then there exist non-zero vectors $e_1$ and $e_2$, such that $Ae_1 = \lambda e_1$ and $Ae_2 = \lambda e_2 + e_1$, where $\lambda$ is either $0$ or $2$.

If $\lambda = 0$, then we get $Ae_1 = A^2 e_2 = 2A e_2 = 2e_1 = 0$, which contradicts the fact that $e_1 \neq 0$.

If $\lambda = 2$, then $2e_1 = Ae_1 = A^2e_2 = 2A e_2 = 4e_2+2e_1$, then $e_2 = 0$ and we again have contradiction.

That means that $A$ is indeed diagonalizable.