Problem: Find all $2 \times 2$ matrices $A$ that commute with all $2 \times 2$ matrices $B$. That is, if $AB = BA$ for all $B \in M_2(\mathbb{R} ),$ what are the possible matrices that $A$ can be?
First check when does an arbitrary $2 \times 2$ matrix will commute with elementary matrices, for example, $\begin{bmatrix}
0 & 1 \\
0 & 0
\end{bmatrix}$.
Finally, check if the above obtained matrix will commute with all $2 \times 2$ real matrices or not.
Solution: Let
\[
A = \begin{bmatrix}
a & b \\
c & d \\
\end{bmatrix},
\]
be a matrix which commutes with all $2 \times 2$ matrices. Let
\[
B =
\begin{bmatrix}
0 & 1 \\
0 & 0
\end{bmatrix}.
\]
Let us check when $A$ will commute with $B$. We have
\begin{align*}
AB = BA & \implies
\begin{bmatrix}
0 & a \\
0 & c \\
\end{bmatrix} =
\begin{bmatrix}
c & d \\
0 & 0 \\
\end{bmatrix} \implies c = 0, \text{ and } a = d.
\end{align*}
Similarly, let
\[
C =
\begin{bmatrix}
0 & 0 \\
1 & 0
\end{bmatrix}.
\]
Then, $AC = CA$ will imply
\[
b = 0 \text{ and } a = d.
\]
Thus, the matrices that commute with $B$ and $C$ are
\[
\left\{
\begin{bmatrix}
a & 0 \\
0 & a \\
\end{bmatrix}: a \in \mathbb{R}
\right\} =
\left\{ a I_2: a \in \mathbb{R} \right\} .
\]
Since, $a I_2$ commutes with every $2 \times 2$ matrix, thus the set of all matrices that commute with all $2 \times 2$ matrices are
\[
\textcolor{blue}{
\boxed{\left\{ \begin{bmatrix}
a & 0 \\
0 & a \\
\end{bmatrix} : a\in \mathbb{R} \right\}}
}
\]