A password reset, a currency conversion, a temperature conversion, a decoding system: all of these depend on one powerful idea in mathematics—undoing. If one rule transforms an input, an inverse rule should bring it back exactly. But how can you prove that two functions really undo each other, instead of just looking similar? The answer is precise and elegant: you verify it by composition of functions.
A function takes an input and produces an output. An inverse function reverses that process. If one function tells how many degrees Fahrenheit correspond to a Celsius temperature, its inverse tells how many degrees Celsius correspond to a Fahrenheit temperature. If one function encodes a message by shifting values, its inverse decodes it.
In algebra, this "undoing" idea is not just intuitive. It has a strict test. Two functions are inverses only if applying one after the other returns the original value. That means the result is not "close," "similar," or "equivalent up to rearranging." It must return exactly the starting input.
Inverse functions are two functions that reverse each other. If \(f\) and \(g\) are inverses, then applying \(f\) and then \(g\) gives back the original input, and applying \(g\) and then \(f\) also gives back the original input.
The inverse of \(f\) is written \(f^{-1}\). This notation does not mean \(\dfrac{1}{f(x)}\). It means the function that undoes \(f\).
For example, if \(f(x) = x + 8\), then the inverse should subtract \(8\), so \(f^{-1}(x) = x - 8\). If you add \(8\) and then subtract \(8\), you return to where you started.
To test whether two functions are inverses, we use composition. If \(f\) and \(g\) are inverses, then both compositions must simplify to the identity function.
[Figure 1] The identity function is the function that leaves every input unchanged. It is written as \(I(x) = x\). So the defining condition for inverse functions is
\[f(g(x)) = x \quad \textrm{and} \quad g(f(x)) = x\]
This means that no matter which function you do first, the second one undoes it completely. That is the algebraic proof.
Be careful: checking only one composition is not enough in a full verification. In many school examples, both will work if the functions are truly inverses, but the formal standard is to verify both.

There is a clear process you can follow each time.
First, identify the two functions you want to test.
Second, find \(f(g(x))\) by substituting the entire expression for \(g(x)\) into \(f\).
Third, simplify carefully. If the result is \(x\), that composition passes.
Fourth, find \(g(f(x))\) by substituting the entire expression for \(f(x)\) into \(g\).
Fifth, simplify again. If this also becomes \(x\), the functions are inverses on the appropriate domain.
When substituting one function into another, parentheses are essential. If \(f(x) = 3x - 5\) and you plug in \(g(x) = 2x + 1\), then \(f(g(x)) = 3(2x + 1) - 5\), not \(3 \cdot 2x + 1 - 5\).
The phrase on the appropriate domain matters because sometimes an algebraic expression simplifies correctly only when inputs are limited to a certain set of values. This becomes especially important with square roots, quadratics, and rational functions.
[Figure 2] Linear functions are the easiest place to start, and they also connect nicely to graph symmetry. Suppose
\[f(x) = 2x + 3 \quad \textrm{and} \quad g(x) = \frac{x - 3}{2}\]
We want to verify by composition that \(g(x)\) is the inverse of \(f(x)\).
Worked example 1
Step 1: Compute \(f(g(x))\).
Substitute \(g(x) = \dfrac{x - 3}{2}\) into \(f(x) = 2x + 3\):
\(f(g(x)) = 2\left(\dfrac{x - 3}{2}\right) + 3 = x - 3 + 3 = x\)
Step 2: Compute \(g(f(x))\).
Substitute \(f(x) = 2x + 3\) into \(g(x) = \dfrac{x - 3}{2}\):
\(g(f(x)) = \dfrac{(2x + 3) - 3}{2} = \dfrac{2x}{2} = x\)
Since both compositions equal \(x\), the functions are inverses.
Notice what happens structurally: \(f\) multiplies by \(2\) and then adds \(3\), while \(g\) subtracts \(3\) and then divides by \(2\). The order reverses. That is a common feature of inverse operations.
On a graph, inverse functions are reflections across the line \(y = x\). The two lines mirror each other across that diagonal because their inputs and outputs are swapped.

Now consider a function involving a fraction:
\[f(x) = \frac{x + 4}{3} \quad \textrm{and} \quad g(x) = 3x - 4\]
These may look different, but inverse functions often do. What matters is whether each one undoes the other.
Worked example 2
Step 1: Find \(f(g(x))\).
Substitute \(g(x) = 3x - 4\) into \(f(x) = \dfrac{x + 4}{3}\):
\(f(g(x)) = \dfrac{(3x - 4) + 4}{3} = \dfrac{3x}{3} = x\)
Step 2: Find \(g(f(x))\).
Substitute \(f(x) = \dfrac{x + 4}{3}\) into \(g(x) = 3x - 4\):
\(g(f(x)) = 3\left(\dfrac{x + 4}{3}\right) - 4 = x + 4 - 4 = x\)
Since both results equal \(x\), the functions are inverses.
This example shows that fractions do not make the process fundamentally different. The key is still careful substitution and simplification.
However, rational functions can also create domain restrictions. For instance, if a function has a denominator that becomes \(0\), then that input is not allowed. When checking inverses, always make sure both functions are defined for the values you use.
Here is where the topic becomes more interesting. A quadratic function like \(f(x) = x^2\) does not have an inverse over all real numbers because two different inputs, such as \(2\) and \(-2\), give the same output. To make it invertible, we must restrict the domain. As [Figure 3] shows, using only one side of the parabola makes the function one-to-one.
Let
\[f(x) = x^2, \quad x \geq 0\]
and let
\[g(x) = \sqrt{x}\]
We will verify that these are inverses on the restricted domain.
Worked example 3
Step 1: Compute \(f(g(x))\).
Substitute \(g(x) = \sqrt{x}\) into \(f(x) = x^2\):
\(f(g(x)) = (\sqrt{x})^2 = x\)
This works for \(x \geq 0\), because \(\sqrt{x}\) is defined only for nonnegative real numbers.
Step 2: Compute \(g(f(x))\).
Substitute \(f(x) = x^2\) into \(g(x) = \sqrt{x}\):
\(g(f(x)) = \sqrt{x^2} = |x|\)
Step 3: Use the domain restriction.
Because \(x \geq 0\), we have \(|x| = x\). So on this restricted domain, \(g(f(x)) = x\).
Therefore, \(f\) and \(g\) are inverses when the domain of \(f\) is restricted to \(x \geq 0\).
This example is extremely important because it shows that inverse relationships depend not only on formulas, but also on allowed inputs. Without the domain restriction, \(\sqrt{x^2} = |x|\), not always \(x\).

Sometimes two functions look like inverses at first glance, but composition exposes the truth immediately.
Suppose
\[f(x) = x^2 \quad \textrm{and} \quad g(x) = \sqrt{x}\]
with no domain restriction on \(f\). Then
\(f(g(x)) = (\sqrt{x})^2 = x\), but \(g(f(x)) = \sqrt{x^2} = |x|\).
That second composition is not always equal to \(x\). For example, if \(x = -5\), then \(|x| = 5\), not \(-5\). So these are not inverses over all real numbers.
Here is another failure case:
\[f(x) = x + 1 \quad \textrm{and} \quad g(x) = x - 2\]
Then
\(f(g(x)) = (x - 2) + 1 = x - 1\), which is not \(x\). So the very first composition already proves they are not inverses.
Many encryption systems rely on reversible operations. In simple mathematical models, encoding and decoding behave like inverse functions: one process transforms data, and the other must return the exact original information.
A function can only have an inverse function if it is one-to-one function on its domain. That means different inputs must always produce different outputs.
If \(f(a) = f(b)\) forces \(a = b\), then \(f\) is one-to-one. If two different inputs can give the same output, the function cannot be reversed uniquely.
Why one-to-one matters
If a function is not one-to-one, an output does not tell you exactly which input produced it. For an inverse to exist as a function, each output must come from only one input. That is why quadratics usually need domain restrictions, while nonhorizontal linear functions automatically have inverses.
Another important fact is that the domain and range switch roles for inverse functions. If the domain of \(f\) is a set \(D\) and the range of \(f\) is a set \(R\), then the domain of \(f^{-1}\) is \(R\), and the range of \(f^{-1}\) is \(D\).
This connects directly to the quadratic example. For \(f(x) = x^2\) with \(x \geq 0\), the domain is \([0, \infty)\) and the range is also \([0, \infty)\). So the inverse \(f^{-1}(x) = \sqrt{x}\) has domain \([0, \infty)\).
The reflection idea from [Figure 3] helps explain this switch visually: every point \((a, b)\) on a function becomes \((b, a)\) on its inverse.
Although the standard algebraic test is composition, graphs help build intuition. If two functions are inverses, their graphs reflect across the line \(y = x\). We saw this for a linear pair in [Figure 2] and for a restricted quadratic pair in [Figure 3].
Real-world formulas often come in inverse pairs. For example, the Celsius-to-Fahrenheit conversion is
\[F(C) = \frac{9}{5}C + 32\]
Its inverse, converting Fahrenheit back to Celsius, is
\[C(F) = \frac{5}{9}(F - 32)\]
If you compose them, you recover the starting temperature. That is not just algebra—it is how engineers, scientists, and medical professionals move reliably between units.
Another application appears in finance and data analysis, where one formula may scale and shift quantities while another restores original values. If a process changes data according to a linear rule, the inverse rule can recover the untransformed measurement.
Application example: temperature conversion
Step 1: Start with Celsius and convert to Fahrenheit.
If \(C = 20\), then \(F(20) = \dfrac{9}{5}(20) + 32 = 36 + 32 = 68\).
Step 2: Apply the inverse conversion.
Now compute \(C(68) = \dfrac{5}{9}(68 - 32) = \dfrac{5}{9}(36) = 20\).
The second function undoes the first exactly, which is the real-world meaning of being inverse.
One common mistake is forgetting parentheses during substitution. For example, if \(g(x) = x - 3\), then substituting into \((x)^2\) must give \((x - 3)^2\), not \(x^2 - 3\).
Another mistake is checking only one composition. To verify inverses fully, compute both \(f(g(x))\) and \(g(f(x))\).
A third mistake is ignoring domain restrictions. The expression \(\sqrt{x^2}\) is not automatically \(x\); it is \(|x|\). That single detail often decides whether two functions are inverses.
Students also sometimes confuse \(f^{-1}(x)\) with \((f(x))^{-1}\). The first means the inverse function. The second usually means the reciprocal of the output, which is a completely different idea.
| Check | What to Ask | Why It Matters |
|---|---|---|
| Composition \(1\) | Does \(f(g(x)) = x\)? | Tests whether \(g\) undoes \(f\) in one order |
| Composition \(2\) | Does \(g(f(x)) = x\)? | Tests whether \(f\) undoes \(g\) in the other order |
| Domain | Are all inputs allowed? | Prevents invalid expressions such as division by \(0\) or square roots of negative numbers |
| One-to-one | Does each output come from only one input? | Determines whether an inverse function can exist |
Table 1. A checklist for verifying whether two functions are inverses.
The most reliable mindset is this: do not guess from appearance. Verify by composition, simplify carefully, and pay attention to the domain.