If matrices $B$ and $AB$ have the same rank, show that they have the same null spaces. Not sure how to do this one. A rather big hint was given, but I can't figure out how to actually do the second half of the hint: 

First show that $null(B)\subseteq null(AB)$, then  use the rank+nullity theorem.

So I figure I got the first part done:
\begin{align}
\vec{x}\in null(B)&\Longrightarrow B\vec{x}=\vec{0}\\
&\Longrightarrow A(B\vec{x})=\vec{0}\\
&\Longrightarrow (AB)\vec{x}=\vec{0}\\
&\Longrightarrow \vec{x}\in null(AB)\\
&\Longrightarrow null(B)\subseteq null(AB)
\end{align}
Not certain how to proceed from here... Any tips would be great.
 A: Based on the suggestions of Vedran, I think the following might be a solution:

If $\vec{x}$ is in the null space of $B$, then:
\begin{align}
\vec{x}\in null(B)&\Longrightarrow B\vec{x}=\vec{0}\\
&\Longrightarrow A(B\vec{x})=\vec{0}\\
&\Longrightarrow(AB)\vec{x}=\vec{0}\\
&\Longrightarrow\vec{x}\in null(AB)\\
&\Longrightarrow null(B)\subseteq null(AB)
\end{align}
Since $null(B)$ is a subspace of $null(AB)$, we can conclude that the nullity of $B$ is less than or equal to the nullity of $AB$.
$A$ is an $m\times n$ matrix while $B$ is an $n\times p$ matrix, $AB$ is an $m\times p$ matrix. Therefore, $B$ and $AB$ both have the same number of columns. Let $p$ equal the number of columns in both $B$ and $AB$.
Let $k$ equal the rank of both $B$ and $AB$. Let $l$ equal the nullity of $B$ and $o$ equal the nullity of $AB$. Given that $B$ and $AB$ have the same number of columns:
\begin{align*}
k+l&=p\\
k+o&=p\\
l&=o
\end{align*}
Therefore, the nullity of $B$ is equal to the nullity of $AB$, and we can then conclude that $null(B)=null(AB)$. $\square$
A: Assume that $A$ is $m\times n$ and $B$ is $n\times p$. What you know from the rank-nullity theorem is that
\begin{gather}
\operatorname{rk}(AB)+\operatorname{nl}(AB)=p\\
\operatorname{rk}(B)+\operatorname{nl}(B)=p
\end{gather}
(where $\operatorname{nl}(X)$ denotes the dimension of $\operatorname{null}(X)$).
You also know that $\operatorname{null}(B)\subseteq\operatorname{null}(AB)$, because $x\in\operatorname{null}(B)$ means $Bx=0$, so that also $ABx=0$. 
Subtract the equalities above, to get …
If $U_1\subseteq U_2$ are subspaces of $V$ and their dimensions …, then $U_1=U_2$.
(Fill in the blanks)
A: HINT:
The rank-nullity theorem tells us that
rank + nullity = no. of columns.
How do the number of columns of $B$ and $AB$ compare? (or do we not know?)
Can we use this to find the nullity of $B$ and/or $AB$?
How does the nullity relate to the nullspace?
.
That should hopefully be quite a lot to go on.
