Onto and One to one functions given composite is also onto or one to one if $f:X→Y$ and $g:Y→Z$ are functions and $g∘f$ is one to one, are $g$ and $f$ also one to one?
Similarly, Are they also onto? How can i prove these or disprove these with examples? 
 A: No. If $g\circ f$ is one-to-one, $f$ is too, but nothing general can be said about $g$, unless $f$ is onto (and hence bijective).
Symmetrically, if $g\circ f$ is onto, $g$ is onto, but nothing can be said about $f$, unless $g$ is one-to-one (and hence bijective.
Example 1: Let $f$ the canonical injection of $\mathbf R_+$ in $\mathbf R$ and $g\colon \mathbf R\rightarrow \mathbf R$ the ‘square’ function; $g\circ f$ is the restriction of the square function to positive numbers, and is thus injective, but $g$ itself is not.
Example 2: Now call $g$ the square function, but considered as a map from $\mathbf R$ to $\mathbf R_+$; $g\circ f$ is again surjective (and even bijective) from $\mathbf R_+$ to  $\mathbf R_+$, but the canonical injection $f$ is not.
A: For one-to-one: what if $X = \{1\}$?
For onto: what if $Z = \{1\}$?
A: If $g\circ f$ is injective then $f$ is injective.
$f$ must be injective. Suppose not: let $x\neq y$ with $f(x)=f(y)$, then $g(f(x))=g(f(y))$, and so $g\circ f$ is not injective.

If $g\circ f$ is onto then $f$ is onto.
for every $z\in Z$ there is $x\in X$ so that $g\circ f(x)=z$. so $g(f(x))=z$. Since $f(x)$ is in $Y$ for every $z\in Z$ there is $y\in Y$ so that $g(y)=z$ (We just have to take $f(x)$)

If $g\circ f$ is injective $g$ is not necessarily injective.
Let $X=Z=\{1,2\}$ and $Y=\{1,2,3\}$ and $f(1)=1,f(2)=2$. $g(1)=1,g(2)=g(3)=2$
(Note that in fact $g\circ f$ is bijection)

If $g\circ f$ is onto then $f$ is not necessarily onto. 
Let $Y=\{1,2\}$ and $X=Z=\{1\}$ Let $f(1)=1$ and $g(1)=g(2)=1$
(Note that in fact $g\circ f$ is bijection)

If $g\circ f$ is injective then $f$ is injective (we proved this already) If $f$ is also onto then $g$ is one one.
Suppose $g$ is not one one. Then let $g(a)=g(b)$. Take $x$ and $y$ so that $f(x)=a$ and $f(y)=b$ (we can do this because $g$ is onto. We have:
$g\circ f(x)=g(f(x))=g(a)=g(b)=g(f(y))=g\circ f(y)$ and so $g\circ f$ is not injective

If $g\circ f$ is onto then $g$ is onto (we proved this already) If $g$ is also injective then $f$ is onto.
Suppose not: So there is $y\in Y$ so that $f(x)\neq y$ for all $x$. Since $g$ is injective $g(f(x))\neq f(y)$ for all $x$. and so $f(y)$ is not in the range of $g\circ f$. contradicting $g\circ f$ is onto.
