I've read that the composition of functions is not commutative but in this case it works. So how can we proof that the composition of a function and its inverse commutative?
$\endgroup$ 41 Answer
$\begingroup$By definition a function $g:X\to Y$ is the inverse of a function $f:Y\to X$ if $f\circ g$ is the identity map of $X$ and $g\circ f$ is the identity map of $Y$.
If $X$ and $Y$ are not the same set, then it makes no sense to say that $f$ and $g$ are commutative, for the result of the two compositions $f\circ g$ and $g\circ f$ cannot be equal simply because their domains and codomains are different.
If, on the other hand, $X$ and $Y$ are the same set, then $f$ and $g$ are commutative simply by definition!