Prove that $T$ is a Linear Transformation , if $T$ is defined by $T(A)=XA-AX$ Let $T : M_{2\times 2} \to M_{2\times 2}$ be defined by 
$$
T(A) =
\begin{pmatrix} 2 & 1 \\ 1 & 2 \end{pmatrix} A
 − A \begin{pmatrix} 2 & 1 \\ 1 & 2 \end{pmatrix}.
$$
How do I prove that $T$ is a linear transformation and then find the basis for the kernel of $T$. The $2\times 2$ matrix multiplied by $A$ confuses me.

Linearity is easy to prove.
Now let $A=\begin{pmatrix} a & b\\ c & d \end{pmatrix}$ then $\begin{pmatrix} a & b \\ c & d \end{pmatrix} \begin{pmatrix} 2 & 1 \\ 1 &2\end{pmatrix}=\begin{pmatrix} 2a+b & a+2b \\ 2c+d & c+2d \end{pmatrix}=D_1$
And $\begin{pmatrix} 2 & 1 \\ 1 & 2 \end{pmatrix}A=\begin{pmatrix} 2a+c & 2b+d \\ a+2c & b+2d \end{pmatrix}=D_2$
Thus $T(A)=D_1-D_2=\begin{pmatrix} b-c & a-d \\ d-a &c-b  \end{pmatrix}$
Now let $T(A)=\mathbb{O}_{2\times2}$ then we have that $b=c$ and $a=d$ thus $A \in ker(T)$ iff $A=\begin{pmatrix} a & b \\ b & a \end{pmatrix}$ for $a,b \in \mathbb{R}$.
Thus $Ker(T)=\{a\begin{pmatrix} 1 & 0 \\ 0 & 1 \end{pmatrix}+b\begin{pmatrix} 0 & 1 \\ 1 & 0 \end{pmatrix}|a,b \in \mathbb{R}\}$ thus $Ker(T)=span(\{\begin{pmatrix} 1 & 0 \\ 0 & 1 \end{pmatrix},\begin{pmatrix} 0 & 1 \\ 1 & 0 \end{pmatrix}\})$
And you can easily see that $\begin{pmatrix} 1 & 0 \\ 0 & 1 \end{pmatrix}$ and $\begin{pmatrix} 0 & 1 \\ 1 & 0 \end{pmatrix}$ are linearly independent.
