composition of injective and surjective functions