We have $A \in \mathbb R ^{\mathrm {mxn} }$ and $B \in \mathbb R ^{\mathrm {nxp}}$ which are two matrices. It is said that $\{ b_1, b_2, ..., b_k\}$, where $k \leq q$, is a basis for $\mathrm{Im}(B)$ and that $\mathrm{Ker}(A)\cap \mathrm{Im}(B) = \{ \vec{0}\}$. We have to show that $\{ Ab_1, Ab_2, ..., Ab_k \}$ form a basis for $\mathrm{Im}(AB)$.
I've tried fiddling with the rank nullity theorem, leading me to this: $$\dim (\mathrm{Im}(AB)) = \dim (\mathrm{Im}(B)) - \dim(\mathrm{Ker}(A)\cap \mathrm{Im}(B)) $$ which makes sense since $\dim(\mathrm{Ker}(A)\cap \mathrm{Im}(B)) = 0 $ (since it only contains the null vector) and since we are asked to show that the basis for $\mathrm{Im}(AB)$ is $\{ Ab_1, Ab_2, ..., Ab_k \}$ (i.e a set with $k$ vectors). But, unfortunately I don't where to go from here. The only thing I've shown is that $\dim (\mathrm{Im}(AB)) = k$
Another approach I tried to have to solve this problem was the following: $$AB\vec{x} = \vec{0} \\ \Leftrightarrow A(B\vec{x}) = \vec{0} \\ \Rightarrow B\vec{x}\in \mathrm{Ker}(A) \\ \text{and}\ B\vec{x}\in \mathrm{Im}(B)$$ but again I don't know where to go from here.
If you want to show that $\{A b_i\}_{i=1}^k$ is a basis, show first that $\{A b_i\}_{i=1}^k$ spans Im$AB$, then show that $\{A b_i\}_{i=1}^k$ is a set of linearly independent vectors. To see that it spans: pick $x \in \mathrm{Im}AB$. That means there exists $z$ such that $x = ABz$. Since $Bz \in \mathrm{Im}B$ and $\{b_i\}_{i=1}^k$ is a basis, there exists real numbers $a_i$ such that $$ Bz = \sum_{i=1}^k a_i b_i \implies \sum_{i=1}^k a_i Ab_i = A\sum_{i=1}^k a_i b_i = ABz = x , $$ which proves that $\{Ab_i\}_{i=1}^k$ spans Im$AB$. It remains to prove that $\{Ab_i\}_{i=1}^k$ are independent. To see that this is true, assume that $$ 0 = \sum_{i=1}^k a_i Ab_i \implies 0 = A\sum_{i=1}^k a_i b_i \implies \sum_{i=1}^k a_i b_i \in \mathrm{Ker}A. $$ We see also $\sum_{i=1}^k a_i b_i \in \mathrm{Im}B$ because Im$B$ is a linear subspace and $\{b_i\}_{i=1}^k$ is a basis, hence $\sum_{i=1}^k a_i b_i \in \mathrm{Im}B$. So $\sum_{i=1}^k a_i b_i \in \mathrm{Ker} A \cap \mathrm{Im} B$. That means $\sum_{i=1}^k a_i b_i = 0$. But since $\{b_i\}_{i=1}^k$ is a basis, that means $\sum_{i=1}^k a_i b_i = 0$ only has the trivial solution $a_i = 0$ for all $i \in \{1,2,\dots,k\}$ , which proves that $\{Ab_i\}_{i=1}^k$ are linearly independent.