Hint: if g o f is an injection, then so is f, and g is injective on the image of f. Perhaps you can start by figuring the number of injective f's.
There are injections .
Now for to be an injection it is not necessary for to be injective.
However, must be injective on the image of
How many functions are there such that the restriction to is an injection?
We have m!/(m-n)! injective functions f from A to B.
We have k!/(k-n)! injective functions g from Im(f) to C.
Why are we counting the the functions g from B to C that are not in the image of f?
I know we have k^(m-n) such as these, but why are we counting them?