I would do it like this:

A is a mxn matrix of rank m, now it is obvius that , why?

So A represents a linear map with rank .

B is a nxp matrix of rank n, it is equally obvius that .

So B represents a linear map with of rank n.

Now AB represents linear , or

So g has a domain of p dimensions, and the codomain has n dimensions.

f has domain of n dimensions, and the codomain has m dimensions.

So represents a map , where V is p dimensional and W is m dimensional. So AB has rank m.

This is what I would do, but there are probably nicer ways. Assuming ofcourse that this is correct.