Is it true that if $f:X\rightarrow Y$ and $g:Y\rightarrow X$ such that $g∘f=I_X,~~f\circ g=I_y$ then $f,g$ must be one-one and onto (i.e. bijective)? Is it true that if $f:X\rightarrow Y$ and $g:Y\rightarrow X$ such that $g\circ f=I_X,~~f\circ g=I_y$ then $f,g$ must be one-one and onto (i.e. bijective)?
Claim. Yes.
Proof. Since $g(f(x))=x \implies g\circ f$ is injective. As if $g\circ f(a)=g\circ f(c)\implies a=c.$
Now, if $f(x)=f(y)\implies g\circ f(x)=g\circ f(y)\implies x=y\implies f$ is injective.
Also, since $g$ is covering every element in $X$ ( just simply take $f(x)$ in $g$). Hence $g$ is surjective.
Similarly with $f(g(x))=x\implies f \text{ is surjective}, g \text{ is injective}$, which impiles $f,g$ are bijective functions and hence $|X|=|Y|$.
Can someone check it? I am not sure that the above is correct.
 A: Yes, your proof is correct.
As a matter of style, don't use the $\implies$ symbol liberally to connect statements in a proof. Use english words instead.
When you say $A\implies B$ it means "if $A$ is true then $B$ is true". When students use it in a proof they usually want to say "$A$ is true so $B$ is true too". But this is stronger!
As a guideline, the $\implies$ symbol should be reserved to a properly quantified and self-contained mathematical statement, as in
$$
\text{for all } f : X\to Y, g : Y \to X, \, g\circ f = I_X \implies g \text{ onto and } f \text{ one to one}.
$$
A good exemple of that in your proof is the following : "as if, $g\circ f(a)=g\circ f(c)\implies a=c.$"
This you can keep, provided you fix the typo (as in instead of as if) and quantify it with "for all $a,c\in X$".
But the other implies shoud be either discarded or replaced by "then" or synonyms.
A: Here is a slightly more general result.
Let $f:X\to Y$ and $g:Y\to Z$ be functions such that $g\circ f:X\to Z$ is a bijection.
Then we can conclude that $g$ is surjective and $f$ is injective. Indeed, let us prove the last claim first.
If $a\in X$ and $b\in X$, we can proceed as follows:
\begin{align*}
f(a) = f(b) \Rightarrow g(f(a)) = g(f(b)) \Rightarrow (g\circ f)(a) = (g\circ f)(b) \Rightarrow a = b
\end{align*}
and we are done.
To prove the surjection of $g$, notice the relation $g(Y)\subseteq Z$ always holds.
We have then to prove that $Z\subseteq g(Y)$:
\begin{align*}
Z = (g\circ f)(X) = g(f(X)) \subseteq g(Y)
\end{align*}
That is because $f(X)\subseteq Y$ and $g\circ f$ is a bijection. In the given case, the functions $f:X\to Y$ and $g:Y\to Z$ are so that $g\circ f$ and $f\circ g$ are bijections and $Z = X$.
Hopefully this helps!
