Injective, surjective and bijective functions I'm attempting the following proof, I need help in the last part and any recommendation is important for me, I appreciate the help:

$2.$ Suppose that $f\colon A\to B$ and $g\colon B\to C$ are functions.
Prove that if $g\circ f$ is injective, then $f$ is injective. Prove that if $g\circ f$ is surjective, then $g$ is surjective. Conclude that if $g\circ f$ is bijective, then $f$ is injective and $g$ is surjective

\begin{align*}
\forall x,y\in A 
&\implies g(f(x)=g(f(y)))
\\
&\implies (g\circ f)(x)=(g\circ f)(y)
\\
&\implies x=y
\end{align*}
$\therefore$ $f$ is injective
Suppose that $c\in C$ $\exists b\in B$ $g(b)=c$. $(g\circ f)(b)=c$ hence $g(f(b))=c$. So $g$ is injective.
 A: You would be better off writing more English and fewer symbols.  I don't know what you're trying to say when you write $\forall x,y \in A \Rightarrow g(f(x)) = g(f(y))$.
To prove that if $g \circ f$ is injective then $f$ is injective, start by writing:  "Suppose $g \circ f$ is injective.  Let $x,y \in A$ be arbitrary and assume that $f(x) = f(y)$."  Now you have to prove that $x = y$.
To prove that if $g \circ f$ is surjective then $g$ is surjective, start by writing:  "Suppose $g \circ f$ is surjective.  Let $c \in C$ be arbitrary."  Now you have to prove $\exists b \in B(g(b) = c)$.
A: I don't think you actually meant to write
$\forall x, y \in A \implies g(f(x)) = g(f(y))$.
That's clearly not true and not what you meant to say at all.  That would mean that every possible pair of $x,y$ that no matter what $g(f(x)) = g(f(y))$.  Always.  Which is not that case.  Suppose $f(x) = x^3$ and $g(x) = x+5$. Then $g\circ f(x) = x^3 + 5$ where is injective.  But obviously we don't have $g(f(7)) = g(f(2))$.
I think what you meant to write was
$\forall x, y \in A;$ then $g(f(x)) = g(f(y)) \implies g\circ f(x) = g\circ f(y) \implies x = y$.
(That is IF $g(f(x)) = g(f(y))$ then $x = y$ but not whenever $g(f(x)) \ne g(f(y))$.   In our example $g(f(a)) = a^3 + 5$ is equal to $g(f(b)) = b^3 = 5$ then $a^3 + 5 = b^3 +5$ so $a^3 = b^3$ and so $a = b$.)
But that does NOT mean $f$ is injective!  You need to prove that if $f(x) = f(y)$ that $x = y$.  You showe that if $g(f(x)) = g(f(y))$ then $x = y$ but you have no reason to assume that $f(x) = f(y)$ in this case.  Nor that these represent all cases where $f(x) = f(y)$.
That is.... you have not considered the cases where:

*

*$g(f(x)) = g(f(y))$ but $f(x) \ne f(y)$.

nor did you consider the cases where


*$f(x) = f(y)$ but $g(f(x)) \ne g(f(y))$.

Can you either discuss those cases?  Or show those cases can't ever happen?  Or come up with a different argument where those cases don't come up?  One that starts by assuming $f(x) = f(y)$ and ends with showing $x = y$....
Discuss those cases:

 Case 1:  If $g(f(x)) = g(f(y))$ then $x = y$ because $g\circ f$ is injective.  And if $x = y$ the whatever we do to $x$ is the same thing as doing it to $y$ so $f(x) = f(y)$.  But that's always the case.  $x = y \implies h(x) = h(y)$ for all functions.  But the reverse $f(x) = f(y)\implies x = y$ need not be true.


 Case 2:  Case two is sort of silly.  If $f(x) = f(y)$ then they are the same thing.  A whatever we do to them will have the same result.  So if $f(x) = f(y)$ then $g(f(x)) = g(f(y))$.  But does that imply $x = y$?  That's what we have to show.

Come up with a different argument.

  Suppose $f(x) = f(y)$.  Then $g(f(x)) = g(f(y))$.  But we know $g\circ f$ is injective.  So $g(f(x)) = g(f(y)) \implies x= y$.  So .....


 $f(x) = f(y) \implies$
$g(f(x)) = g(f(y)) \implies$
$x = y$ and therefore $f$ is injective.

