(i) for every $x \in D_f, f(x) \in D_g$
, and $g(f(x))=x$, and
(ii) for every $x \in D_g, g(x) \in D_f$ , and
$f(g(x))=x$.
Facts:
If $g$ is an inverse function for $f$ and
$\hat g$ is an inverse function for $f$ then $g = \hat g$.
A function $f$ has an inverse function $g$ if
and only if $f$ is one to one with $D_g = \{ y \in R : y= f(x)$
for some $ x \in D_f\}$