Let there be two arbitrary functions $f$ and $g$, and let $g \circ f$ be their composition.
Suppose $g \circ f$ is one-one. Then prove that this implies $f$ is also one-one.
Suppose $g \circ f$ is onto. Then prove that this implies $g$ is also onto.
I tried to do both of the proofs by contradiction method but got stuck in that approach. Please help me in this proof. Proofs in more than one way is welcomed.