$R(AB)=R(A)$ iff rank$(AB)$=rank$(A)$, $N(AB)=N(B)$ iff rank$(AB)$=rank$(B)$ 
$A$ and $B$ are two square matrices then show that $R(AB) = R(A)$ iff $\mathrm{rank} (AB) = \mathrm{rank} (A)$, and $N(AB) = N(B)$ iff $\mathrm{rank} (AB) = \mathrm{rank} (B)$. 

Here is my attempt:
Clearly $R(A)\supset R(AB)$, now can we say that these two subspaces are identical iff they have the same dimension?
also i know $N(AB)\supset N(B)$ but i am not finding a way to prove converse part.
Thanks for giving me time.
 A: Note that $R(AB)\subseteq R(A)$ always holds: if $x$ is any vector, then $AB(x) = A(Bx)\in R(A)$.
Thus, if $\mathrm{rank}(AB)=\mathrm{rank}(A)$, then that means that $\dim(R(AB))=\dim(R(A))$; since $R(AB)\subseteq R(A)$, equality of dimensions suffices to conclude that $R(AB)=R(A)$, because we are in finite dimension. Conversely, if $R(AB)=R(A)$, then they necessarily have the same dimension, hence the ranks of $AB$ and of $A$ must be equal. 
(Yes: if $V$ is finite dimensional, and $W\leq V$, then $W=V$ if and only if $\dim(W)=\dim(V)$: if $\dim(W)=\dim(V)$, then take a basis for $W$; then this already has the right number of elements to be a basis for $V$, and since it is linearly independent, it spans $V$; since it also spans $W$, we have $V=W$. Conversely, if $V=W$, then $\dim(V)=\dim(W)$. This does not work if $\dim(V)$ is infinite, and also does not work if you don't know that $W$ is contained in $V$; but if you have both conditions, it does.)
Similarly, $N(B)\subseteq N(AB)$, since $Bx=0$ implies $ABx=0$. Thus:
$$\begin{align*}
N(B)=N(AB) &\iff \dim(N(B))=\dim(N(AB))\\
&\iff \mathrm{null}(B)=\mathrm{null}(AB)\\
&\iff n-\mathrm{null}(B) = n-\mathrm{null}(AB)\\
&\iff \mathrm{rank}(B) = \mathrm{rank}(AB)
\end{align*}$$
with the last equivalence by the Rank-Nullity Theorem.
A: The key issue here is that any basis for a (finite dimensional) subspace $S$ must have exactly $\dim S$ elements.
You are given that $R(AB)\subset R(A)$. Let $\{v_1,...,v_r\}$ be a basis for $R(AB)$ (where $r=\dim R(AB)$, of course). Then for some $b_i$, we have $v_i = AB b_i = A (B b_i)$. Then we have $\{v_1,...,v_r\} \subset R(A)$, and since $\dim R(A) = r$, these vectors must be a basis for $R(A)$. This allows us to conclude $R(AB) = R(A)$.
Exactly the same reasoning (well, not exactly, you find a basis of $\ker B$ first) shows that if $\dim \ker B = \dim \ker AB$, then $N(AB) = N(B)$.
