TITLE: A be a $3\times 3$ matrix over $\mathbb {R}$ such that $AB =BA$ for all matrices $B$. what can we say about such matrix $A$
QUESTION [6 upvotes]: Let $A$ be a $3\times 3$ matrix over $\mathbb {R}$ such that $AB =BA$ for all matrices $B$ over $\mathbb {R}$ then what can we say about such matrix $A$. 
or such matrix $A$ must be orthogonal matrix? Can we say anything about its eigen values?
 I tried by taking random examples also tried to construct such $3 \times 3$ matrices. But i am not able to get any proper conclusion and proof.

REPLY [2 votes]: Here is a simple exercise which I find useful few times.
Exercise Let $D$ be a diagonal matrix, with pairwise distinct diagonal entries. Then $D$ commutes only with diagonal matrices.
Proof: Let $CD=DC$. Equaling the $ij$ entries in these matrices we get:
$$c_{ij}d_{jj}=d_{ii}c_{ij}$$
Thus, if $i \neq j$we have $d_{ii} \neq d_{jj}$ and thus $c_{ij}=0$..
Now back to your problem. Pick $B$ a diagonal matrix with pairwise distinct diagonal entries. Then $AB=BA$ implies that $A$ is diagonal.
Next pick $B$ the matrix with all ones, that is $b_{ij}=1 \forall i,j$. $AB=BA$  and $A$ diagonal implies that all entries of $A$ are equal.