Since all surjective functions are epic, it follows that surjective homomorphisms are too.
The converse requires more care.
Let 𝜙 :𝐺 ↠𝐻 be an epimorphism and 𝐴 =𝜙(𝐺).
It is sufficient to show 𝐴 =𝐻.
Consider the set 𝐺/𝐴 of left-cosets of 𝐴 in 𝐺,
and let 𝑢 be a unique symbol,
𝑆 =𝐺/𝐴 ⨿{𝑢},
and 𝑆! denote the permutation group of the set 𝑆.
We define a homomorphism 𝜓1 :𝐻 →𝑆! so that for any ℎ,ℎ1 ∈𝐻
𝜓1(ℎ):𝐴ℎ1↦𝐴ℎ1ℎ𝑢↦𝑢Let 𝜎 ∈𝑆! be the permutation which swaps 𝐴 and 𝑢 and leaves everything else invariant,
and let ˆ𝜎 be its induced inner automorphism.
Then 𝜓2 =ˆ𝜎𝜓1 is also a homomorphism.
Now, for any 𝑎 ∈𝐴 it follows 𝜓1(𝑎) leaves both 𝐴 and 𝑢 fixed (the latter is by construction),
and hence 𝜎 commutes with 𝜓1 and thus 𝜓2(𝑎) =ˆ𝜎𝜓1(𝑎) =𝜓1(𝑎).
Hence 𝜓1𝜙 =𝜓2𝜙,
and since 𝜙 is epic 𝜓1 =𝜓2.
But thence follows that 𝜎 commutes with 𝜓1(ℎ) for all ℎ ∈𝐻,
wherefore 𝜓1(ℎ) must leave 𝐴 fixed,
and thus 𝜓1(ℎ) =ℎ𝐴 =𝐴 and thus ℎ ∈𝐴 for all ℎ ∈𝐻.