If $AB=BA$ for all $Bs$, prove that $A=kI$? Given $n\times n$ matrix A, if for all $n\times n$ matrices $B$, $AB=BA$ is true,
Prove that  $A=kI$
Any hints or solutions would be appreciated. Thanks.
 A: Hint - choose B carefully to restrict the possibilities for A - it doesn't have to be invertible, so try simple forms which make the calculation easy (most entries = 0, for example).
Then work from there.
A: It is obvious that the set $\{kI\mid k\in F^{\times}\}$ is a subgroup of $GL_n(F)$. Now assume that $T\in GL_n(F)$ is not a linear scalar transformation so use this fact that there is a $v$ such that $v, T(v)$ are independent and so the set $\{v,T(v)\}$ can be extended to a basis for the space. From here conclude that the set $\{v,v+T(v),v_3,...,v_n\}$ is also a basis for the space where $\{v,T(v),v_3,...,v_n\}$ is the extended basis. Now, you have a $S\in GL_n(F)$ such that $$S(v)=v,~~ ST(v)=v+T(v), S(v_i)=v_i, ~~3\leq i\leq n$$. This means that $T$ is not in the centre of $GL_n(F)$.
A: If $A$ commutes with all matrices in $M_n(\mathbb{R})$ then $A$ commutes with all matrices in $M_n(\mathbb{C}))$ since $M_n(\mathbb{C})=M_n(\mathbb{R})+i M_n(\mathbb{R})$. Now, there exist $P,Q \in GL_n(\mathbb{C})$ such that $PAP^{-1}$ and $QAQ^{-1}$ are respectively upper and lower triangular. Therefore, $A$ is both upper and lower triangular that is diagonal. Now, use matrices with only one nonzero entry to conclude.
A: Note that the set of all matrices of the form $kI$ in the ring $M_n(K)$ of $n \times n$ matrices over a field $K$  is isomorphic to $K$. What we are trying to prove is that the centre of $M_n(K)$ is indeed $K$ (which we identified with the diagonal matrices).
Let $e_{ij}$ the be the $n \times n$ matrix with $1$ at the $(i,j)$-th entry and $0$ elsewhere.  It is easy to show that, if $A=(a_{ij})$, then $a_{ij}I=\sum \limits_{r=1}^{n} e_{ri}Ae_{jr}$ and that $e_{ij} e_{rs}= \delta _{jr}e_{is}$, where $\delta _{jr}$ is the Kronecker delta. Also $\sum \limits_{r=1}^{n} e_{rr}=I$.
Note that $kI$ commutes with every matrix, as $B(kI)=k(BI)=kB=(kI)B$ (by basic properties of matrix multiplication). Now suppose $A=(a_{ij})$ commutes with every matrix, then $a_{ij}I=\sum \limits_{r=1}^{n} e_{ri}Ae_{jr}=\sum \limits_{r=1}^{n} Ae_{ri}e_{jr}=\sum \limits_{r=1}^{n} A \delta _{ij}e_{rr}=A \delta _{ij} \sum \limits_{r=1}^{n}e_{rr}=A\delta _{ij}$, so $A$ is indeed diagonal.
