When I teach students about inverse functions, every textbook says that you have to test both $f(g(x))$ and $g(f(x))$ to see if they equal $x$. However, I've never seen a case where one of those equals $x$ and the other doesn't which makes me question if you really have to look at both cases.
So my question is, are there two functions, $f$ and $g$, such that $f(g(x)) = x$ but $g(f(x)) \ne x$?
$g:[0,1]\rightarrow [0,2]$, $g(x)=x$ and $f:[0,2]\rightarrow [0,1]$, $f(x)=min(x,1)$.