Let $f: A\to B; \ g,h:B\to A$ and $f\circ g = I_B$ and $h \circ f = I_A$
I want to simply state that for any function $f$ if $f \circ h = I_A$ then it must be that $h = f^{-1}$ but that seems incomplete to me. What can I do for fixing this?
Let $f: A\to B; \ g,h:B\to A$ and $f\circ g = I_B$ and $h \circ f = I_A$
I want to simply state that for any function $f$ if $f \circ h = I_A$ then it must be that $h = f^{-1}$ but that seems incomplete to me. What can I do for fixing this?
You just need that $h\circ f=I_A$ for some $h\colon B\to A$.
Indeed, if $f(x)=f(y)$, for some $x,y\in A$, then also $h(f(x))=h(f(y))$ and therefore $x=y$, due to $h\circ f=I_A$.
If there exists also $g\colon B\to A$ with $f\circ g=I_B$, then $f$ is surjective and $g=h$. Only in this case you can state that $g=h=f^{-1}$.
Post compose $I_B$ with $h$, then $$h\circ f\circ g = h\circ I_B=h,$$
but $h\circ f=I_A$, so $h=g$.
Since $f$ has right and left inverse, it is a bijection, in particular it is injective.