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).
 A: Both of your proofs are correct.
A: I've never taken an analysis course but I don't believe that your first proof is correct. Since take for example $f=x^2$, which isn't one-to-one. $g \circ f (-2)$ and $g \circ f (2)$ would be equal, since in both cases it is $g(4)$ and $g$ is a function. So $x$ would not have to equal $y$ and thus $f$ does not have a requirement of being one-to-one for the composition $g(f(x))$ to be one to one. However I do believe that $g$ would have to be one to one for that to be the case. Please correct me if I am wrong. Just my two cents.
A: (i) If $f \circ g$ is one-to-one, then it is invertible. Its inverse is $g^{-1} \circ f^{-1}.$ Thus $f^{-1}$ exists. Therefore, $f$ is invertible, and thus is one-to-one. QED.
A: On the first one i would say since g composed of f is one-to-one, if g(f(x))=g(f(y)) for all x,y in A then x=y. By definition of f then there exist some value f(x) and f(y) in B. Then because we already noted x=y. F(x) must equal F(y) by the definition of a function.  
