= Inverse function
{title2=$f^{-1}$}
{wiki}
= Inverse map
{synonym}
An <inverse function> reverses a <bijection>. For $f:X\to Y$, it is a <function> $g:Y\to X$ satisfying
$$
g\circ f=\operatorname{id}_X,\qquad f\circ g=\operatorname{id}_Y.
$$
Equivalently, $g(f(x))=x$ for all $x\in X$ and $f(g(y))=y$ for all $y\in Y$. We write $g=f^{-1}$. The superscript denotes reversal through <function composition>; it does not mean the pointwise <multiplicative inverse> $1/f(x)$. The <preimage> notation $f^{-1}(B)$ for a <set> $B$ is also distinct: a <preimage> exists even when no <inverse function> exists.
For a computed example, let $f:\mathbb R\to\mathbb R$ be $f(x)=2x+1$. Solving $y=2x+1$ for $x$ gives $g(y)=(y-1)/2$. Thus $f(1)=3$ and $g(3)=1$; direct substitution gives $g(f(x))=x$ and $f(g(y))=y$ throughout the <real line>. In contrast, $1/f(3)=1/7$, which does not undo $f(1)=3$.
Why must $f$ be a <bijection>? If $f(x_1)=f(x_2)$, applying $g$ gives $x_1=x_2$, proving <injectivity>. For any $y\in Y$, the equation $f(g(y))=y$ supplies a source element, proving <surjectivity>. Conversely, a <bijection> supplies exactly one predecessor for each $y$, defining a unique <inverse function>. A <left inverse> or <right inverse> requires only one of the two composition identities.
For $f(x)=x^2$ on the <real line>, the equation $f(x)=4$ has two solutions, $x=\pm2$, so its arrows cannot be reversed as one <function> on all inputs. The <restriction> to $[0,\infty)$ removes that ambiguity. As a <bijection> from $[0,\infty)$ onto $[0,\infty)$, it has <inverse function> $g(y)=\sqrt y$. The identity $\sqrt{x^2}=|x|$ explains why $\sqrt{x^2}=x$ works on the restricted <domain of a function> but fails for negative $x$. https://openstax.org/books/calculus-volume-1/pages/1-4-inverse-functions[OpenStax, inverse functions and domain restrictions]{ref}.
\Image[/inverse-function-reflection.png]
{title=An inverse function swaps the input and output coordinates}
{description=Left: the <function graphs> of $f(x)=2x+1$ and its <inverse function> $g(x)=(x-1)/2$ are reflections across the <line> $y=x$; the points $(1,3)$ and $(3,1)$ correspond. Right: the nonnegative <restriction> $x\mapsto x^2$ and the <square root> have the same reflection relation. Their displayed portions lie in the first <quadrant> or on its <boundary>.}
More generally, $(a,b)$ lies on the <graph of a function> $f$ precisely when $(b,a)$ lies on the <graph of a function> of its <inverse function>. This coordinate swap explains the geometric reflection and the <horizontal line test>. It also explains why inverse sensitivity is reciprocal locally: the <inverse function rule> divides by the original <derivative> at the corresponding input, when that <derivative> is nonzero.
Back to article page