If two matrices commute with a nonscalar matrix resp., they commute with each other Let $A \in M_2(\mathbb C)$ be an arbitrary matrix which is not scalar. (In what follows the matrices are elements of $M_2(\mathbb C)$.) Then let $X := \{B \mid AB = BA\}$.  Here I would like to show that if $S,T\in X$, $ST = TS$.
I figured out that the condition that $A$ is not scalar is equivalent to saying that $X$ is properly contained in $M_2(\mathbb C)$, and that $X$ is closed under multiplication, but I  cannot go any further.
I would appreciate for your help.
 A: I'd like to post the solution Julien indicated, in detail:
$2\times 2$ matrices are either: 


*

*diagonalizable with repeated eigenvalues (scalar) 

*diagonalizable with different eigenvalues, or 

*non-diagonalizable, i.e. similar to 
$$\left ( \begin {matrix} \lambda &1\\0 &\lambda \end {matrix} \right ). $$
The question deletes case #1. For case #2, if a $2\times 2$ matrix is diagonalizable with non-repeated eigenvalues, it has a spectral decomposition 
$$A = \lambda_1 P_1 + \lambda_2 P_2, \text { for } P_1 + P_2 = I \text { a resolution of identity}.$$
If $B$ commutes with $A$, then it commutes with each projection $P_i$; therefore, $B$ preserves the one-dimensional spaces $\operatorname{range}{P_i}$. Therefore these are eigenspaces for $B$. So $B$ is diagonalizable with respect to the same basis as $A$. This relation is clearly transitive, and the problem is solved in case #2.
For case #3, $A$ is similar to $\lambda I + N$, for $N$ a $2\times 2$ nilpotent Jordan block. If $PAP^{-1}=\lambda I + N$, denote by $B'$ the matrix $PBP^{-1}$. Since $\lambda I$ commutes with everything, a matrix $B'$ commutes with $\lambda I + N$ iff it commutes with $N$. It can be shown that the only matrices which commute with $N$ are polynomials in $N$, i.e. of the form $a_0I + a_1N$ (these are the only polynomials since $N^2 =0$). 
So if $B_1$ and $B_2$ commute with $A$, then $PB_1P^{-1}$ and $PB_1P^{-1}$ are both polynomials in $N$, and so they commute with each other. So $B_1$ and $B_2$ commute with each other, ending case #3.
