injective and surjective How to prove that a composite function $f\circ g$ is bijective$?$
because i have two questions.
if $f$ is injective and $g$ is surjective, can $g\circ f$ be both injective and surjective?
because the question assumes both sets to be the same criteria ( $f$ injective, $g$ surjective) , so one question is whether $g\circ f$ is injective and the other is if $g\circ f$ is surjective.
i proved that if $f$ is injective then, $x=y$, $f(x)=f(y)$, then $g(f(x)) = g (f(y))$ so $g\circ f$ is injective.
but is it true that if $f$ is injective and $g$ is surjective, then $g\circ f$ can also be surjective. its making me confused.
 A: "if $f$ injective and $g$ surjective can $g\circ f$ be both injective and surjective?" 
Sure, e.g. let $f:\{0\}\rightarrow\mathbb R$ and $g:\mathbb R\rightarrow\{0\}$.
But not always, e.g. let $g:\{0,1,2\}\rightarrow\{0,1\}$ be prescribed by $0\mapsto0$, $1\mapsto1$, $2\mapsto1$ and let $f:\{0,1\}\rightarrow\{0,1,2\}$ be prescribed by $0\mapsto1$, $1\mapsto2$. 
Then $f$ is injective and $g$ is surjective.
However $g\circ f:\{0,1\}\rightarrow\{0,1\}$ is constant (and prescribed by $0\mapsto1$ and $1\mapsto1$). 
It is evidently not injective and is not surjective. 
A: drhab's answer is excellent. However, I want to add two more things that are true.
Theorem
Let $f: A \rightarrow B, g: B \rightarrow C$ be surjective functions. Then $g \circ f: A \rightarrow C$ is a surjection.
Proof:
Let $c \in C$. Then, there exists $b \in B$ such that $g(b) = c$ (because $g$ is surjective). Because $b \in B$, there exists $a \in A$ such that $f(a) = b$
Therefore, $c = g(f(a)) = g \circ f(a)$, leading us to conclude that $g \circ f$ is a surjection. $\quad \triangle$
Theorem
Let $f: A \rightarrow B, g: B \rightarrow C$ be injective functions.Then $g \circ f: A \rightarrow C$ is an injection.
Proof
Let $a,a' \in A$ such that $g \circ f(a) = g \circ f(a')$
equivalently, we can say:
$g(f(a)) = g(f(a'))$
and by injectivity of $g$:
$f(a) = f(a')$
and by injectivity of $f$
$a = a'$
Hence, $g \circ f$ is injective.$\quad \triangle$
From the two previous theorems, it immediately follows that the composition of $2$ bijective functions is bijective.
