# Composition of functions that are onto or one-to-one

I found part of my answer here: If g(f(x)) is one-to-one (injective) show f(x) is also one-to-one (given that...); however I wanted to flesh out the last two statements I had in a proposition in my notes.

Proposition: Let $f: A \rightarrow B$ and $g: B \rightarrow C$. Then:

(i) If $g \circ f$ is one-to-one, then $f$ is one-to-one.

(ii) If $g \circ f$ is onto, then $g$ is onto.

Proof: (i) Suppose $f(x)=f(y)$ for some $x,y$.

Since $g \circ f$ is one-to-one: $$g\circ f(x) = g\circ f(y) \Rightarrow x=y,\forall x,y \in A.$$

Therefore $f$ must be one-to-one.

(ii) Since $g \circ f (x)$ is onto, then for every $c \in C$ there exists an $a \in A$ such that $c=g(f(a))$. Then there exists a $b \in B$ with $b=f(a)$ such that $g(b)=c$. Thus g is onto.

I wanted to confirm that these proofs are both correct for my peace of mind (as they weren't proven in class).

-