Inverse Functions

The inverse function of a function $f$ is a function that takes in an output of $f$ as an argument, and it answers the question "which input did $f$ take when it gave this output". In other words, $$ (\text{inverse function of $f$})(f(x)) = x, $$ for all inputs $x$ (usually numbers, but they could also be e.g. vectors).

For example, let $f(x) = 2x$ and $g(x) = \frac{x}{2}$. Now $g$ is the inverse function of $f$, because $$ g(f(x)) = \frac{2x}{2} = x $$ for all numbers $x$.

The inverse function of $f$ is often denoted with $f^{-1}$. Be careful to not confuse this notation with powers. For example, $3^{-1} = \frac{1}{3}$ is a number, but if $f(x) = 2x$, then $f^{-1}$ is a function, given by $f^{-1}(x)=\frac{x}{2}$. It is not same as $f(x)^{-1} = (2x)^{-1} = \frac{1}{2x}$.

Issues

One problem is functions that don't produce all possible outputs. For example, the function $f(x) = 2^x$ outputs only positive values. Its inverse function seems to be $g(x) = \log_2(x)$, because $g(f(x)) = \log_2(2^x) = x$. However, $g(-1)$ is undefined, because there is no input $x$ for which $f(x) = -1$. We can work around this problem and still say that $g$ is an inverse function of $f$ by defining "an output" to mean a positive number, not any number whatsoever. In general, redefining the concept of "an output" solves this problem.

A more fatal problem is functions that produce the same output for two different inputs, $f(a)=f(b)$ even though $a\ne b$. For example, let $f(x) = x^2$. Now we have $f(2) = 4 = f(-2)$, so what should $(\text{inverse function of $f$})(4)$ do? Should that evaluate to $2$ or $-2$? We don't want to just pick one choice randomly, so instead we say that it's undefined.

If one or both of these problems occurs, the inverse function doesn't exist. If neither of them occurs, it means that the function gets all possible outputs, and no output occurs with two different inputs. Because there is exactly one output corresponding to each input, the inverse function can just find the input corresponding to a given output, so it exists.

The inverse function of $f$ exists if and only if both of the following two conditions are met: