Given, f : A → B and g : B → C are onto.
Then, gof : A → C
Let us take an element z in the co-domain (C).
Now, z is in C and g : B → C is onto.
So, there exists some element y in B, such that g (y) = z ... (1)
Now, y is in B and f : A → B is onto.
So, there exists some x in A, such that f (x) = y ... (2)
From (1) and (2),
z = g (y) = g (f (x)) = (gof) (x)
So, z = (gof) (x), where x is in A.
Hence, gof is onto.