I want to prove the following thing:
Let f : $X \to Y$ with right inverse g: $Y \to X$, if f has one and only one right inverse, then it is injective.
I know that if a function g is a right inverse then f $\circ$ g = $Id_y$.
My proof is by contradiction, but I do not think it is very rigorous.
If f is not injective, then we would have $g(y_1) \neq g(y_2) \rightarrow f(g(y_1) = f(g(y_2)$ which is equivalent to: $g(y_1) \neq g(y_2) \rightarrow y_1 = y_2$
But this is not possible because the right nverse is unique.
Can this argument work?