Definition:Inverse Mapping/Definition 2

Definition
Let $S$ and $T$ be sets. Let $f: S \to T$ and $g: T \to S$ be mappings.

Let:
 * $g \circ f = I_S$
 * $f \circ g = I_T$

where:
 * $g \circ f$ and $f \circ g$ denotes the composition of $f$ with $g$ in either order
 * $I_S$ and $I_T$ denote the identity mappings on $S$ and $T$ respectively.

That is, $f$ and $g$ are both left inverse mappings and right inverse mappings of each other.

Then:
 * $g$ is the inverse (mapping) of $f$
 * $f$ is the inverse (mapping) of $g$.

Also see

 * Equivalence of Definitions of Inverse Mapping