I am stuck on a composition function Proof.

Let f:A-->B and g:B-->D. Prove that g 0 f is onto and g is 1-1, then f must be onto.

I have ( and am not sure if it is correct...)

Let f:A-->B and g:B-->D

Let all d be and element of D and there exists and a in A such that f(a)=b.

Then (g o f)(a)=g(f(a))

=g(b)

=d

Therefore, g o f is onto

Where I am a little confused is it looks like to me is that f:A-->B would not only have to be onto but also one to one...