Prove that $U$ is a vector-subspace 
If $U$ is the set of all matrices that are commutative with the matrix
  $A$, show that $U$ is a vector subspace of the space 
  $M^\mathbb{R}_{3\times 3}$
$$A=\begin{pmatrix}2&0&1\\ 0&1&1\\ 3&0&4\end{pmatrix}$$
Also show if it contains the $$\operatorname{span}(I,A,A^2,...)$$ and then find the dimension of $U$ and the base.

Can someone explain how would I prove that $U$ is a subspace and maybe point out a good example/text book that has lots of similar examples for me to practice upon.
P.S. I know that for $U$ to be a subspace it has to be "closed" for the operations of addition and multiplication. But I have no clue on how to prove it.
 A: Hint:
If $AB_i=B_iA,i=1,2$ then also $(B_1-B_2)A=A(B_1-B_2),$ and $(rB_1)A=A(rB_1).$ Now try to fill in the details?  
Hope this helps.  
P.S. I don't know about good references, sorry.
A: Suppose $B,C \in U$. Then $$(B+C)A = BA + CA = AB + AC = A(B+C).$$ So $B+C\in U$. Similarly if $c \in \mathbb{R}$, $$(cB)A = c(BA) = c(AB) = A(cB).$$
So $U$ is a subspace.
Now note that $IA = AI$ so $I \in U$. Also $A^kA = A^{k+1} = AA^k$. So $A^k \in U$ for all $k > 1$. Since U is a subspace, and $I, A, A^2,\dots \in U$, $$span(I,A,A^2,\dots) \subseteq U.$$
Now let's tackle the commuting. There is some general theory that can help us here, I will only use the Jordan form (though we could be even more slick about our approach).
Let J denote the Jordan Form of A. $$J = \begin{pmatrix}
1 & 1 & 0 \\
0 & 1 & 0 \\
0 & 0 & 5
\end{pmatrix}_.$$
$A$ is similar to $J$, that is there is an invertible matrix $S$ such that $A = SJS^{-1}$. Here $$S = \begin{pmatrix}
0 & -1 & 4 \\
1 & 0 & 3 \\
0 & 1 & 12\\
\end{pmatrix}_.$$
Suppose $B \in U$. Let $C = S^{-1}BS$. Then $JC = S^-1ASS^{-1}BS = S^{-1}ABS = S^{-1}BAS = S^{-1}BSS^{-1}AS = CJ$. So $C$ commutes with $J$. Similarly if you have a matrix that commutes with $J$, it corresponds to an element of $U$. So instead of trying to find matrices that commute with $A$, we can work with $J$ and then pass through the change of coordinates to get a matrix that commutes with $A$.
Now here is where I will work harder rather than smarter. We could do less work because of the block form of $J$, but I will take a less elegant approach.
Take an arbitrary matrix:
$$\begin{pmatrix}
a & b & c \\
d & e & f \\
g & h & i \\
\end{pmatrix}_.$$
Let's see how it interacts with J:
$$\begin{pmatrix}
a & b & c \\
d & e & f \\
g & h & i \\
\end{pmatrix} \begin{pmatrix}
1 & 1 & 0 \\
0 & 1 & 0 \\
0 & 0 & 5
\end{pmatrix} = \begin{pmatrix}
a & a+b & 5c \\
d & d+e & 5f \\
g & g+f & 5i \\
\end{pmatrix}_.$$
$$\begin{pmatrix}
1 & 1 & 0 \\
0 & 1 & 0 \\
0 & 0 & 5
\end{pmatrix} \begin{pmatrix}
a & b & c \\
d & e & f \\
g & h & i \\
\end{pmatrix} = \begin{pmatrix}
a + d & b + e & c + f\\
d & e & f\\
5g & 5h & 5i\\
\end{pmatrix}$$
Setting these matrices equal to each other (hence forcing commutativity) yields a bunch of equations. Solving these equations gives: $d = g = f = h = c = 0$, $a = e$, $b$ and $i$ are free.
So our arbitrary matrix looks like 
$$\begin{pmatrix}
a & b & 0\\
0 & a & 0\\
0 & 0 & i\\
\end{pmatrix}$$
So a basis of the space of matrices commuting with $J$ is $$\begin{pmatrix}
1 & 0 & 0\\
0 & 1 & 0\\
0 & 0 & 0\\
\end{pmatrix}_, \begin{pmatrix}
0 & 1 & 0 \\
0 & 0 & 0 \\
0 & 0 & 0 \\
\end{pmatrix}_, \begin{pmatrix}
0 & 0 & 0 \\
0 & 0 & 0 \\
0 & 0 & 1 \\
\end{pmatrix}_.$$
Now a basis of $U$ is $$S\begin{pmatrix}
1 & 0 & 0\\
0 & 1 & 0\\
0 & 0 & 0\\
\end{pmatrix}S^{-1}_, \ S\begin{pmatrix}
0 & 1 & 0 \\
0 & 0 & 0 \\
0 & 0 & 0 \\
\end{pmatrix}S^{-1}_, \ S\begin{pmatrix}
0 & 0 & 0 \\
0 & 0 & 0 \\
0 & 0 & 1 \\
\end{pmatrix}S^{-1}_.$$
