One-to-One Function

A one-to-one function is a function in which distinct elements in the domain correspond to distinct outputs in the range. In other words, no two different values in the domain share the same output. These functions are also called injective functions.

Mapping diagram of a one-to-one function between two sets
One-to-one function. Distinct elements in set A map to distinct outputs in set B.
Mapping diagram of a function that is not one-to-one where two elements share the same output
Function that is not one-to-one. Distinct elements c and d share the same output.

Formally, a function \(f\) is one-to-one (or injective) if and only if for any \(a\) and \(b\) in its domain:

$$f(a) = f(b) \rightarrow a = b$$

This means that if the outputs of two elements are equal, then those two elements must be the same. Equivalently (using its contrapositive), if \(a \neq b\), then \(f(a) \neq f(b)\) must hold.

Conversely, a function in which at least two distinct values in the domain produce the same output is not one-to-one. For example, the quadratic function \(f(x) = x^2\) is not one-to-one because the inputs \(x = 3\) and \(x = -3\) yield the same output: \(f(3) = f(-3) = 9.\) On the other hand, the cubic function \(g(x) = x^3\) is one-to-one, since every real number in its domain has a unique output different from that of any other input.

In everyday life, we can picture this relationship in a classroom with students and assigned seats: if each student occupies a unique seat and no seat is shared by two students, the assignment between students and seats works like a one-to-one function.

Graphical Interpretation of One-to-One Functions

In the Cartesian plane, the one-to-one condition has a direct visual interpretation using lines parallel to the horizontal axis (the x-axis). If a function is one-to-one, each output value comes from a single input in the domain, so no horizontal line can intersect its graph at more than one point.

Horizontal Line Test: A function is one-to-one if and only if every horizontal line intersects its graph at most once (that is, at one point or at no points at all).

On the other hand, if there is at least one horizontal line that crosses the curve at two or more points, it means that distinct x-values share the same y-value, and therefore the function is not one-to-one. We can compare this behavior between the graphs of \(f(x) = x^2\) and \(g(x) = x^3\):

Horizontal Line Test applied to the graph of the quadratic function f(x) = x²
The quadratic function f(x) = x2 is not one-to-one: horizontal lines intersect its graph at two points.
Horizontal Line Test applied to the graph of the cubic function g(x) = x³
The cubic function g(x) = x3 is one-to-one: every horizontal line intersects its graph at a single point.

Do not confuse being one-to-one with the definition of a function: both properties require uniqueness, but in opposite directions. The definition of a function requires each input x to have a single output y (which is verified graphically using the Vertical Line Test), while still allowing multiple x-values to share the same output. A one-to-one function adds the reverse condition: each output y can come from only one input x (which is checked using the Horizontal Line Test).

How to Tell If a Function Is One-to-One

Depending on the given information and the complexity of the expression, there are different strategies to determine whether a function is one-to-one:

  • Algebraic method: starts from the formal definition by setting the outputs of two generic elements in the domain equal to each other to check if the inputs must necessarily be equal.
  • Graphical method: uses the Horizontal Line Test when the graph of the curve in the Cartesian plane is available.
  • Counterexamples and monotonicity: allow you to quickly rule out a one-to-one relationship using two inputs with the same output, or confirm it by analyzing whether the function is strictly increasing or strictly decreasing.

Algebraic Method

This procedure consists of taking two arbitrary elements \(a\) and \(b\) from the domain of the function, setting their outputs equal \(f(a) = f(b)\), and solving algebraically. If the only possible conclusion is \(a = b\), then the function is one-to-one; if other relationships between \(a\) and \(b\) appear, it is not.

Example 1

Determine whether the quadratic function \(f(x) = x^2 + 1\) is one-to-one on its domain \(\mathbb{R}.\)

We begin by finding the outputs of two generic elements \(a\) and \(b\) in the domain:

$$f(a) = a^2 + 1$$

$$f(b) = b^2 + 1$$

We set both expressions equal to each other and solve the resulting equation:

$$f(a) = f(b)$$

$$a^2 + 1 = b^2 + 1$$

$$a^2 = b^2$$

When taking the square root of both sides, we must remember that \(\sqrt{x^2} = |x|\), which gives:

$$|a| = |b|$$

$$a = \pm b$$

Since we arrive at \(a = b\) or \(a = -b\) (for instance, \(a = 2\) and \(b = -2\) satisfy the equation), the inputs are not guaranteed to be equal. Therefore, the function is not one-to-one.

Example 2

Prove whether the linear function \(g(x) = 3x + 2\) is one-to-one.

We apply the same procedure by writing the outputs for \(a\) and \(b\) and setting them equal:

$$g(a) = 3a + 2$$

$$g(b) = 3b + 2$$

$$g(a) = g(b)$$

$$3a + 2 = 3b + 2$$

$$3a = 3b$$

$$a = b$$

Starting from equal outputs, we have arrived exclusively at \(a = b.\) Consequently, the linear function is one-to-one.

Example 3

Analyze whether the rational function \(h(x) = \dfrac{2x - 1}{x + 3}\), with domain \(\mathbb{R} - \{-3\}\), is one-to-one.

We set up the equation \(h(a) = h(b)\) with \(a, b \neq -3\) and cross-multiply to clear the denominators:

$$\frac{2a - 1}{a + 3} = \frac{2b - 1}{b + 3}$$

$$(2a - 1)(b + 3) = (2b - 1)(a + 3)$$

We expand both products and combine like terms:

$$2ab + 6a - b - 3 = 2ab + 6b - a - 3$$

$$6a - b = 6b - a$$

$$7a = 7b$$

$$a = b$$

Since equal outputs lead solely to \(a = b\), we conclude that this rational function is one-to-one.

Horizontal Line Test (Graphical Method)

When we know the graph of a function, visual analysis is immediate: we draw imaginary horizontal lines at various heights and verify that none of them intersects the curve at two or more points.

Example 1

Determine from its graph whether the function \(h(x) = 2x + 1\) is one-to-one.

We examine the line in the Cartesian plane and verify that any horizontal line intersects the graph at a single point:

Horizontal Line Test on the graph of the linear function h(x) = 2x + 1
The function h(x) = 2x + 1 is one-to-one: no horizontal line intersects its graph at more than one point.

Example 2

Check graphically whether the cubic function \(y = x^3 + 3x^2\) is one-to-one.

By drawing horizontal lines across the curve, we notice that near the horizontal axis there are lines that intersect the graph at three distinct points:

Horizontal Line Test on the graph of the cubic function y = x³ + 3x²
The function y = x3 + 3x2 is not one-to-one: horizontal lines intersect its graph at up to three points.

About piecewise functions: having each piece of a piecewise function be one-to-one individually does not guarantee that the entire function is one-to-one. For the overall function to be one-to-one, the ranges of the different pieces must not overlap; if a horizontal line crosses two separate pieces at the same height, the function is no longer one-to-one.

Using Counterexamples (to Prove a Function Is Not One-to-One)

Sometimes, solving \(f(a) = f(b)\) produces higher-degree equations that are difficult to factor. If we suspect that a function is not one-to-one, it is enough to provide a counterexample: two specific, distinct numbers in the domain (\(a \neq b\)) that yield the exact same output.

A practical strategy is to check whether the function has more than one real root (that is, whether it crosses the x-axis at two or more points). If we find two different values where the function equals zero, both share the output \(0\), immediately proving that the function is not one-to-one.

Similarly, no even function (one that satisfies \(f(-x) = f(x)\) for all \(x\) in its domain) is one-to-one if its domain contains at least one nonzero number, because any value \(x \neq 0\) and its opposite \(-x\) share the same output.

Example

Verify that the polynomial function \(f(x) = x^3 - 3x\) is not one-to-one.

Instead of expanding the cubic equation \(a^3 - 3a = b^3 - 3b\), we look for its roots by factoring the expression: \(x^3 - 3x = x(x^2 - 3) = 0.\) From this factorization, we see that both \(x = 0\) and \(x = \sqrt{3}\) make the function equal to zero:

$$f(0) = 0^3 - 3(0) = 0$$

$$f(\sqrt{3}) = (\sqrt{3})^3 - 3\sqrt{3} = 3\sqrt{3} - 3\sqrt{3} = 0$$

Since \(0 \neq \sqrt{3}\) while \(f(0) = f(\sqrt{3}) = 0\), there are two distinct elements in the domain with the same output, so the function is not one-to-one.

Monotonicity Criterion (Increasing and Decreasing Behavior)

On the other hand, we can confirm that a function is one-to-one by analyzing its increasing or decreasing behavior without having to solve \(f(a) = f(b)\). Recall that a function is strictly increasing on an interval if for every pair \(a < b\) we have \(f(a) < f(b)\), and it is strictly decreasing if for every \(a < b\) we have \(f(a) > f(b)\).

Every function that is strictly increasing or strictly decreasing across its entire domain is one-to-one. The reason is straightforward: given any two distinct elements \(a \neq b\), one must be smaller than the other (\(a < b\) or \(b < a\)); as we move from the smaller input to the larger one, the function always goes up or always goes down, so its outputs can never repeat (\(f(a) \neq f(b)\)).

Example

Prove using monotonicity that the function \(f(x) = x^3 + x\) is one-to-one on all of \(\mathbb{R}.\)

Take any two real numbers such that \(a < b.\) Because cubing preserves the direction of inequalities in the real numbers, we know that \(a^3 < b^3.\) Adding both inequalities side by side gives:

$$a^3 + a < b^3 + b$$

$$f(a) < f(b)$$

This shows that \(f\) is strictly increasing on all of \(\mathbb{R}\), meaning it never repeats values and is a one-to-one function.

Keep in mind that global monotonicity is a sufficient condition, not a necessary one: a function can fail to be monotonic across its entire domain and still be one-to-one. A classic case is the rational function \(y = \frac{1}{x}\), which is decreasing on \((-\infty, 0)\) and decreasing on \((0, \infty)\), but not across its whole domain \(\mathbb{R} - \{0\}\) (since \(-1 < 1\) yet \(f(-1) = -1 < f(1) = 1\)); nevertheless, no output is ever repeated, so the function is one-to-one.

How to Make a Function One-to-One by Restricting the Domain

Restricting the domain of a function means narrowing its original set of inputs down to a specific subset on which no two values share the same output. In this way, a function that was not initially one-to-one becomes one-to-one over that new restricted domain.

Although there are infinitely many intervals on which a function can become one-to-one (for example, restricting \(f(x) = x^2\) to the interval \([5, 10]\)), by mathematical convention we always choose the largest possible domain restriction (minimal cut): the widest subset of the original domain that still covers the entire range of the function without repeating any outputs.

Example 1

Determine a standard domain restriction so that the quadratic function \(f(x) = x^2\) becomes one-to-one.

On its natural domain \(\mathbb{R}\), this function is not one-to-one because every positive number and its opposite share the same output (for instance, \(f(2) = f(-2) = 4\)). To avoid duplicate outputs while keeping the entire range \([0, \infty)\), we split the parabola right at its vertex \(x = 0\) and keep just one of its branches: the interval \([0, \infty)\), or alternatively \((-\infty, 0]\). If we call \(f_R\) the function with restricted domain \([0, \infty)\), its graph passes the Horizontal Line Test:

Graph of the quadratic function f(x) = x² with domain restricted to [0, ∞)
Restricting the domain of f(x) = x2 to the interval \([0, \infty)\) makes the function one-to-one.

Example 2

Analyze how to restrict the domain of the trigonometric function \(g(x) = \sin(x)\) to make it one-to-one.

Because of its periodic behavior, the sine function repeats the same values infinitely across \(\mathbb{R}\) (for example, \(\sin(0) = \sin(\pi) = 0\)). To obtain the largest interval centered around the origin, we look for the widest continuous interval where the function covers its entire range \([-1, 1]\) without turning back. That interval starts at its local minimum \(x = -\frac{\pi}{2}\), where \(\sin\left(-\frac{\pi}{2}\right) = -1\), and ends at its local maximum \(x = \frac{\pi}{2}\), where \(\sin\left(\frac{\pi}{2}\right) = 1.\) On the interval \(\left[-\frac{\pi}{2}, \frac{\pi}{2}\right]\), the function is strictly increasing and hits each output exactly once.

Example 3

Find the largest domain restrictions that make the function \(h(x) = (x - 2)^2 + 1\) one-to-one.

Notice that this expression represents a parabola with vertex at \((2, 1)\), which decreases for values less than \(2\) and increases for values greater than \(2.\) To eliminate the symmetry between both branches without losing any values from the range \([1, \infty)\), we split the domain at the x-coordinate of the vertex. Thus, the two standard domain restrictions are the intervals \([2, \infty)\) and \((-\infty, 2]\).

Why One-to-One Functions Matter

Being one-to-one is one of the two essential requirements for a function to have an inverse function \(f^{-1}\) (the other requirement is being onto, or surjective; when both hold, the function is called bijective). While being onto can easily be achieved by adjusting the codomain to match the range, being one-to-one requires that the rule itself never maps distinct inputs to the same output.

To avoid confusion among these three classifications when analyzing a function, it helps to distinguish what each property controls:

  • One-to-one function (injective): no element in the codomain is hit by more than one arrow from the domain (distinct inputs have distinct outputs).
  • Onto function (surjective): every element in the codomain is hit by at least one arrow (the range equals the codomain).
  • Bijective function: satisfies both conditions at once; every element in the codomain is the output of a unique element in the domain, guaranteeing a one-to-one correspondence between both sets.

The reason a function must be one-to-one to have an inverse comes directly from the definition of a function: if two distinct elements \(a \neq b\) had the same output \(y\), trying to "work backward" from \(y\) to the original domain would give at least two possible outputs (\(a\) and \(b\)), which violates the single-output rule that every function must satisfy.

Example 1

Show how being one-to-one allows us to find the inverse of the linear function \(g(x) = 3x + 2.\)

As we proved earlier using the algebraic method, this function is one-to-one on all of \(\mathbb{R}\). Writing \(y = 3x + 2\) and solving for \(x\) in terms of \(y\), we get:

$$y - 2 = 3x$$

$$x = \frac{y - 2}{3}$$

Swapping the variables gives the inverse function \(g^{-1}(x) = \dfrac{x - 2}{3}.\) For every input \(x\), this formula returns a single, unambiguous output.

Example 2

Analyze what happens when trying to invert \(f(x) = x^2\) before and after restricting its domain.

If we start with \(y = x^2\) on all of \(\mathbb{R}\) and solve for \(x\), a double solution appears due to the lack of injectivity:

$$x = \pm\sqrt{y}$$

For an output such as \(y = 9\), there are two possible inputs (\(x = 3\) and \(x = -3\)), so the inverse relation is not a function. However, once we apply the domain restriction \([0, \infty)\) from the previous section (along with restricting the codomain to match the range), all \(x\)-values are greater than or equal to zero; this allows us to discard the negative sign and unambiguously define the inverse function \(f^{-1}(x) = \sqrt{x}.\) This exact same principle is used to define inverse trigonometric functions, such as \(\arcsin(x)\) from \(\sin(x)\) restricted to \(\left[-\frac{\pi}{2}, \frac{\pi}{2}\right]\).

Summary by Function Type and Examples

To quickly identify the behavior of the most common expressions without going through the full algebraic proof every time, you can refer to the following general properties by function family:

Function TypeOne-to-One?ExampleNote or Condition
Linear (non-constant)Yes\(f(x) = 2x - 5\)One-to-one on all of \(\mathbb{R}\) as long as its slope is nonzero.
ConstantNo\(f(x) = -4\)Every value in the domain shares the exact same output.
Odd powerYes\(f(x) = x^3\)Holds for any expression \(x^n\) with an odd natural exponent \(n\).
Even powerNo\(f(x) = x^2\)For \(x^n\) with even \(n\), opposite inputs share the same output; requires domain restriction.
ExponentialYes\(f(x) = e^x\)Strictly increasing or decreasing on all of \(\mathbb{R}\) depending on its base.
LogarithmicYes\(f(x) = \ln(x)\)One-to-one across its entire natural domain \((0, \infty)\).
Odd-index radicalYes\(f(x) = \sqrt[3]{x}\)Defined and one-to-one for all real numbers.
Even-index radicalYes\(f(x) = \sqrt{x}\)One-to-one on its natural domain \([0, \infty)\) since it considers only the principal (non-negative) root.
TrigonometricNo\(f(x) = \sin(x)\)Because they are periodic, they require a domain restriction to be one-to-one.

Examples of One-to-One Functions

Below are several specific functions that satisfy the one-to-one condition on their respective natural domains:

  • \(f(x) = x - 1\) (linear function with slope \(1\))
  • \(g(x) = x^5 + 3\) (polynomial function strictly increasing on all of \(\mathbb{R}\))
  • \(h(x) = \dfrac{1}{x}\) (rational function defined on \(\mathbb{R} - \{0\}\))
  • \(p(x) = \sqrt{x + 1}\) (even-index radical function defined on \([-1, \infty)\))
  • \(q(x) = \log_2(x)\) (logarithmic function defined on \((0, \infty)\))

Examples of Functions That Are Not One-to-One

In contrast, the following functions are not one-to-one on their natural domains because there are at least two distinct inputs that produce the same output:

  • \(f(x) = 3x^2 + 4\) (for example, \(f(1) = f(-1) = 7\))
  • \(g(x) = |x|\) (for example, \(g(4) = g(-4) = 4\))
  • \(h(x) = 3x^3 + 5x^2\) (has two distinct roots: \(h(0) = h(-5/3) = 0\))
  • \(p(x) = -5\) (any pair of real numbers returns the output \(-5\))
  • \(q(x) = \cos(x)\) (for example, \(\cos(0) = \cos(2\pi) = 1\))

Did you find this useful? Rate it!

0.0 / 5 — 0 votes

Daniel Machado

Mathematics teacher and administrator of Flamath, where he shares content about Mathematical Logic

HOW TO CITE THIS ARTICLE
Machado, D. (2026, December 2). One-to-One Function. Flamath. https://en.flamath.com/one-to-one-function

Related Articles

Leave a Reply

Your email address will not be published. Required fields are marked *