There is a question in my textbook as follows:
Prove that for a square matrix $A$ to be commutable with any other square matrix $B$ (meaning that $AB=BA$), it is necessary and sufficient for $A$ to be a scalar matrix(i.e., to be of the form $cI$, where $c$ is a scalar and $I$ is the identity matrix).
I have proved the sufficiency part as below:
Given $A=cI$
Then $AB=cIB=cB$ and $BA=cBI=cB$.
Hence, it is proved that $AB=BA$.
But I cannot prove the necessity part, i.e., given $AB=BA$, I cannot prove that $A$ is of the form $cI$.
Please anyone help me solve it. Thanks in advance.