# Let $f:X\rightarrow Y$ and $g:Y\rightarrow X$ satisfice $g\circ f=1_x$. Prove $f$ is injective and $g$ is surjective.

Let $f:X\rightarrow Y$ and $g:Y\rightarrow X$ satisfice $g\circ f=1_x$. Prove $f$ is injective and $g$ is surjective.

We need define $f(x)=x$ and $g(y)=y$ then $(g \circ f)(x)=g(f(x))=g(x)=x$

Prove $f$ is injective:

Let $x_1,x_2\in X$ such that $f(x_1)=f(x_2)$ then by definition $x_1=x_2$.
In consequence,
$f$ is injective.

Prove $g$ is surjective:

Here 'im a little stuck. Can someone help me?

For surjectivity of $g:Y\to X$, we need to show that any $x\in X$ is in image of $g$, that is we need to find at least a $y\in Y$ such that $g(y)=x$. Well it is easily done by picking $y=f(x)$ since $g(y)=g(f(x))=x$.
For $x\in X$, then $(g\circ f)(x)=1_{X}(x)$, so $g(f(x))=x$, note that $f(x)\in Y$ and is such that $g(f(x))=x$, so $g$ is surjective.