I am arguing from the given supposition:

if g(f(x))=h(f(x)) then g(y)=h(y)

(f maps from A to B, g and h map from B to C)

to the conclusion that f is surjective

I'm trying to argue to a contradiction by supposing that f isn't surjective...do you think that will work? Any suggestions?