$g \circ f$ surjective and $f \circ g$ injective $\implies$ $f$ and $g$ are bijections Let $f : A \to B$ and $g: B \to A$ be functions. Show that
$g \circ f$ surjective and $f \circ g$ injective $\implies$ $f$ and $g$ are bijective.
My attempt:
Suppose $g(x) = g(y)$. Then $f(g(x)) = f(g(y))$ so that $x = y$ by injectivity of $f \circ g$.
Now let $y \in A$. By sujectivity of $g \circ f$, there exists $x \in A$ such that $g(f(x)) = y$. But $z = f(x) \in A$ so we have $g(z) = y$ and hence $g$ is surjective.
I have that $g$ is bijective but I am stuck with proving that $f$ is bijective.
 A: Hint: You have that $g$ is bijective. Use the following facts about bijective, injective and surjective functions:


*

*Every bijective function $h: C \to D$ has an inverse $h^{-1}: D \to C$ so that $h \circ h^{-1} = id_D$ and $h^{-1} \circ h = id_C$.

*If you compose a bijective function with an injective function (in either order), you get an injective function.

*If you compose a bijective function with a surjective function (in either order), you get a surjective function.

A: since $gof$ is Surjective for every $y \in A$ $\exists$ $x \in A$ such that
$$gof(x)=y$$ $\implies$
$$g(f(x))=y \tag{1}$$
But since we know that $g$ is surjective, for every $y \in A$ $\exists$ $z \in B$ such that
$$g(z)=y \tag{2}$$ Using $(2)$ in $(1)$ we get
$$g(f(x))=g(z)$$ But since $g$ is Injective
$$f(x)=z$$ which proves $f$ is Surjective.
A: Use the following facts to do your heavy lifting:

Proposition A. Given functions $g : Z \leftarrow Y$ and $f : Y \leftarrow X$...
  
  
*
  
*If $g \circ f$ is surjective, then so too is $g$.
  
*If $g \circ f$ is injective, then so too is $f$.

The proof is left as an exercise for the reader.

Proposition B. Given a function $f : Y \leftarrow X$ and a pair of isomorphisms $$\beta : Z \leftarrow Y \qquad \alpha : X \leftarrow W,$$ we have:
  
  
*
  
*The following are equivalent:
$f$ is surjective, $\qquad$ $\beta \circ f$ is surjective, $\qquad$
  $f \circ \alpha$ is surjective
  
*The following are equivalent:
$f$ is injective, $\qquad$ $\beta \circ f$ is injective, $\qquad$ $f \circ \alpha$ is injective

Once again, the proof is left as an exercise for the reader.
Let us now turn our attention to your problem.

Claim. Given functions $q : A \leftarrow B$ and $p : B \leftarrow A$, if $q \circ p$ is surjective and $p \circ q$ is
  injective, then $q$ and $p$ are isomorphisms.

Proof. From A1 and the surjectivity of $q \circ p$, we deduce that $q$ is surjective. From A2 and the injectivity of $p \circ q$, we deduce that $q$ is injective. Hence $q$ is an isomorphism.
From B1 and the surjectivity of $q \circ p$, we deduce that $p$ is surjective. From B2 and the injectivity of $q \circ p$, we deduce that $p$ is injective. Hence $q$ is an isomorphism. QED
