Prove that $AB=BA$ for all $B \implies A=c \cdot I $ for some $c$ where $I$ is an identity matrix.
Both $A,B\in M_{n \times n}.$ I don't know how attempt proof.
Prove that $AB=BA$ for all $B \implies A=c \cdot I $ for some $c$ where $I$ is an identity matrix.
Both $A,B\in M_{n \times n}.$ I don't know how attempt proof.
Use special matrices. If $E_{h}$ is the matrix having $1$ in place $(h,h)$ and $0$ elsewhere, then $AE_{h}$ is the matrix $$ \begin{matrix} [\,0&\dots&0&a_h&0&\dots&0\,]\\ &&&\uparrow\\ &&& \scriptstyle h \end{matrix} $$ having all zero columns except for the $h$-th column, which is the $h$-th column of $A$. Similarly, the matrix $E_{h}A$ is the matrix having all zero rows except for the $h$-th row, which is the $h$-th row of $A$.
In particular, $a_{hj}=0$ for $j\ne h$. Since $h$ is arbitrary, we conclude that $A$ is diagonal.
Now consider the matrix $E_{hk}$ that's obtained from the identity by switching the $h$-th row with the $k$-th row (for $h\ne k$). It's easy to show that $E_{hk}$ is the matrix obtained from $A$ by switching the $h$-th row with the $k$-th row. Similarly, $AE_{hk}$ is obtained from $A$ by switching the $h$-th column with the $k$-th column.
Thus, by comparing $E_{1k}A$ with $AE_{1k}$, we conclude that the coefficient in place $(h,h)$ of $A$ is the same as the coefficient in place $(1,1)$.
Therefore all coefficients on the diagonal are equal. Call this common coefficient $c$ and we have proved that $A=cI$.
Note that this uses only matrix multiplication where the special matrices used have only coefficients $0$ and $1$, so it holds for matrices over any commutative ring.