Question on Inverse of a function

62 Views Asked by At

Let's consider $f:A\to B$. I thought that if we find another function $g$ such that

$f\circ g=id$ and $g\circ f =id$ then $g$ is the inverse function of $f$ (and vice versa).

However, our tutor said that this isn't true without further explaining why...

What am I missing? There must be a detail I don't see...Maybe someone has an example?