# The Inverse of a Function

Consider a function $f : A \to B$ such that for each $x \in A$ we have $f(x) = y$ for some $y \in B$. One question that might arise is whether there's a function, $g : B \to A$ such that for each $y \in B$ we have that $g(y) = x$ for each $x \in A$. In essence, does a function $g : B \to A$ exist such that $g$ reverses $f$?

Suppose that $f$ is not injective. Then there exists elements $x_1, x_2 \in A$ such that $f(x_1) = y f(x_2)$. Therefore such a reversing function cannot exist since then we would have that $g(y) = x_1$ and $g(y) = x_2$ which violates the definition of $g$ being a function (remember a function is a rule that assign each element in its domain to *one* element in its codomain).

Suppose instead that $f$ is not surjective. Then there exists an element $y \in B$ such that there exists no element in $A$ that maps to $y$. Then $g(y)$ will be undefined, which is also problematic.

It can be proven that such a function $g$ that reverses $f$ exists if and only if $f : A \to B$ is a bijective function, and we define this function as the inverse of $f$:

Definition: If $f : A \to B$ is a bijective function defined for each $x \in A$ by $f(x) = y$ for $y \in B$ then the Inverse Function of $f$ is the function $f^{-1} : B \to A$ defined for each $y \in B$ by $f^{-1} (y) = x$ for $x \in A$. |

For example, consider the function $f : \mathbb{R} \to \mathbb{R}$ defined by $f(x) = 3x$. We saw on the Injective, Surjective, and Bijective Functions page that $f$ is bijective. The inverse function is the function $f^{-1} (y) = x$. Let $y = 3x$. Then $\frac{y}{3} = x$ and so:

(1)Using a change of variable we have:

(2)For example, consider $f(2)$. We have that $f(2) = 3(2) = 6$. Now:

(3)In fact, for all $x \in A$, if $f : A \to B$ is bijective then $f^{-1}(f(x)) = x$ and $f(f^{-1}(x)) = x$.