Tom K. answered 11/09/20
Knowledgeable and Friendly Math and Statistics Tutor
No. Consider the trivial example X = the integers, Y = the reals, and Z = the integers, and let
f(x) = x and g(x) = x
Y is not onto. Consider any non-integer y in Y. There is no value in X for which f(x) = y
However, for every z in Z, let x = z; then g(f(z)) = g(z) = z. Thus, it is onto.