We have this question for homework:
Let $h: B\to A$ be the left inverse of $f$, and $g:B\to A$ the right inverse of $f$. Prove that that $h$ and $g$ are the same function.
To prove this I stated "Let $a\in A$ and $b\in B$ such that $f(a)=b$ and $g(b)=a$."
My question is: is that even legal to assume so?
If it is then all there's left to show is that $h(f(a)) = h(b) \neq g(b) = a$ is a contradiction to $h$ being an inverse function of $f$...