Composition and Onto Functions Exercise: If $f:X\rightarrow Y$ and $g: Y\rightarrow Z$ are both onto functions, prove or disprove, $g\circ f:X\rightarrow Z$ defined by $(g\circ f)(x)=g(f(x))$ is an onto function.
Just a little confused on how to do this problem. I know what an Onto function is, and what a composition function is but I don't know how to approach this problem, please help? thanks
 A: The standard play to verify "onto" when at the element level of functions is to pick something in the range and verify that something in the domain is mapped to it.
Since the only thing you can say about an onto function is that every element of the range is actually taken by the function for something (possibly more than one something) in the domain.  Thus $ f: X \rightarrow Y$ surjective means $$\forall y \in Y, \exists x \in X \text{ such that } f(x) = y$$  Similarly $ g: Y \rightarrow Z$ surjective means $$\forall z \in Z, \exists y \in Y \text{ such that } g(y) = z$$
What you want to know is $$\forall z \in Z, \exists x \in X \text{ such that } g \circ f(x) = z$$  To check this, pick some $z \in Z$.  Show there's some $y \in Y$ such that $g(y) = z$.  Now show there's some $x \in X$ such that $f(x) = y$.  Put those together and show $g(f(x)) = g(y) = z$.  Then you've shown each thing in $Z$ has something in $X$ that is (eventually) mapped to it by $g \circ f$. 
A: Let $z\in Z$. Since $g$ is onto, there exists a $y\in Y$ such that $g(y)=z$. Since $f$ is onto, there exists an $x\in X$ such that $f(x)=y$. Can you finish the proof from here?
A: I know two equivalent definitions for an onto function:
First: $h: \text{dom}(h) \rightarrow \text{codom}(h)$ is onto if every element of $\text{codom}(h)$ be an image of some element of $\text{dom}(h)$ under h, i.e.
$$\forall y\in \text{codom}(h) \exists x\in \text{dom}(h) \text{ such that } h(x) = y.$$
Second: $h: \text{dom}(h) \rightarrow \text{codom}(h)$ is onto if the range of $h$ be the codomain of $h$, i.e.
$$h(\text{dom}(h))=\text{codom}(h).$$
Here I prefer to use the second one (maybe because it's faster!):
Since
$f$ and $g$ are onto so
$$(g\circ f)(X)=g(f(X))=g(Y)=Z$$
thus $(g\circ f): X \rightarrow Z$ is onto. 
