Let $f:X\to Y$ and $g:Y\to X$ be maps such that $fg=id_Y$ and $gf=Id_X$, then $f$ is bijective.
I already proved that $f$ is injective. Let $x,x'\in X$ and $f(x)=f(x')$. Then we have $g(f(x))=g(f(x'))$ and therefore $x=x'$. Hence $f(x)=f(x') \iff x=x'$ and $f$ is injective.
How do I prove that $f$ is surjective?
Let $y\in Y$. Choose $x=\cdots$. Then ... Therefore $f(x)=y$.
Can someone help me?