why do we need to assume φ is onto?
i would simply define:
the question is, is this mapping well-defined?
note that if then:
hence , since H is abelian.
that is, G' ⊆ ker(φ).
now suppose that G'x = G'y, so that
then so and therefore:
, justifying our definition of .
nowhere did i use the surjectivity of φ.
suppose is another such map, and let be the canonical projection given by .
then .
since is surjective, it has a right-inverse, that is a function such that .
therefore:
, so
( is unique because of the way we defined it, using the universal property of the canonical quotient map).
but φ doesn't have to be onto. look, say i have this example:
given .
that is a perfectly good homomorphism, and it is NOT surjective.
now explicitly, G' = {e, (1 2 3), (1 3 2)}, as one can see by computing all 36 commutators. so in this case, we have G/G' = {G', (1 2)G'}.
so the map is given by:
which is not surjective.
the key fact is that the canonical projection is surjective. and that's all we care about, because we really only care about the homomorphic image of φ (whatever happens in the rest of H isn't of any interest to us, since it never gets "hit" with φ).
my point being, in actual practice, it might be easier to define φ and H, rather than define a priori some subgroup of H that φ maps surjectively to (we might only discover what this subgroup is by investigating φ in some detail).
in some problems in group theory, it is indeed key to require surjectivity (because you need to exhibit some pre-image). here, since "abelianness" is hereditary (for subgroups), we don't have to worry about it, we know the image of φ is abelian because it is a subgroup of an abelian group. so all we need to know is that φ factors through the abelianization (that is, that ker(φ) contains all of G').