One-to-One Functions

A function is one-to-one if it never assigns the same output to two different inputs. This property is essential for defining inverse functions and is easily detected from a graph using the horizontal line test.

Quick Reference

Concept Description
One-to-one (injective) $f(x_1) = f(x_2) \Rightarrow x_1 = x_2$
Equivalent condition $x_1 \neq x_2 \Rightarrow f(x_1) \neq f(x_2)$
Horizontal line test Every horizontal line meets the graph at most once
Monotonic $\Rightarrow$ one-to-one Every increasing or decreasing function is injective

What Is a One-to-One Function?

A function may assign the same output value to more than one input. For example, $f(x) = x^2$ assigns the value $4$ to both $x = 2$ and $x = -2$. Similarly, $f(x) = |x|$ gives the same output for $x = a$ and $x = -a$, and a constant function $f(x) = c$ takes the same value everywhere.

By contrast, $f(x) = 2x + 3$ produces a distinct output for every input. Such functions are called one-to-one (or injective) functions.

A function $f : A \to B$ is one-to-one (or an injection) if for all $x_1, x_2$ in $A$:

$f(x_1) = f(x_2) \implies x_1 = x_2. \tag{a}$

Equivalently, whenever $x_1 \neq x_2$ in $A$:

$x_1 \neq x_2 \implies f(x_1) \neq f(x_2). \tag{b}$

In other words, a one-to-one function takes on each value in its range exactly once.

Horizontal Line Test

If the graph of $y = f(x)$ is cut by a horizontal line $y = c$ at more than one point, then the value $c$ corresponds to more than one input, and the function is not one-to-one. This gives a quick visual test:

Horizontal Line Test: A function is one-to-one if and only if every horizontal line $y = c$ intersects the graph of $y = f(x)$ at most once.

Examples

Let $f(x) = mx + b$ ($m \neq 0$). Is $f$ a one-to-one function?

Solution Method 1 (algebraic): If $mx_1 + b = mx_2 + b$, then $mx_1 = mx_2$, so $x_1 = x_2$. Thus $f$ is one-to-one. Method 2 (graphical): Each horizontal line $y = c$ intersects the graph of a non-horizontal line exactly once, so $f$ passes the horizontal line test.
Graph of a linear function y = mx + b illustrating it passes the horizontal line test (one-to-one).
Each horizontal line intersects the graph of a linear function exactly once.

Let $f(x) = x^2 + 1$. Is $f$ a one-to-one function?

Solution Method 1 (algebraic): If $x_1^2 + 1 = x_2^2 + 1$, then $x_1^2 = x_2^2$, so $x_1 = x_2$ or $x_1 = -x_2$. Because two different inputs can give the same output, $f$ is not one-to-one. Method 2 (graphical): A horizontal line $y = c$ with $c > 1$ intersects the parabola at two points, failing the horizontal line test.
Graph of the parabola y = x² + 1 illustrating it fails the horizontal line test (not one-to-one).
$y = x^2 + 1$ is not one-to-one on its entire domain $\mathbb{R}$.
Restricting the domain: Although $f$ is not one-to-one on all of $\mathbb{R}$, if we restrict to $x \geq 0$, the function $f : [0, \infty) \to \mathbb{R}$ with $f(x) = x^2 + 1$ passes the horizontal line test and becomes one-to-one. (Similarly, the restriction to $x \leq 0$ is also one-to-one.)
Graph of y = x² + 1 restricted to x ≥ 0, showing it passes the horizontal line test.
Restricting the domain of $f(x) = x^2 + 1$ to $[0, \infty)$ makes it one-to-one: each horizontal line meets the graph at most once.

Let $f : \mathbb{R} - \{0\} \to \mathbb{R}$, where $f(x) = 1/x$. Is $f$ a one-to-one function?

Solution Method 1 (algebraic): If $1/x_1 = 1/x_2$, then $x_1 = x_2$. So $f$ is one-to-one. Method 2 (graphical): Each horizontal line $y = c$ with $c \neq 0$ intersects the hyperbola exactly once, and $y = 0$ never intersects it.
Graph of the hyperbola y = 1/x showing it passes the horizontal line test.
Each horizontal line intersects the graph of $y = 1/x$ at most once.

Summary Table of Common Functions

Function Natural Domain One-to-one?
$f(x) = x^n$ ($n$ even) $\mathbb{R}$ No
$f(x) = x^n$ ($n$ odd) $\mathbb{R}$ Yes
$f(x) = \sqrt[n]{x}$ ($n$ even) $[0, \infty)$ Yes
$f(x) = \sqrt[n]{x}$ ($n$ odd) $\mathbb{R}$ Yes
$f(x) = 1/x^n$ ($n$ even) $\mathbb{R} - \{0\}$ No
$f(x) = 1/x^n$ ($n$ odd) $\mathbb{R} - \{0\}$ Yes

Every monotonic function is one-to-one. If $f$ is increasing and $x_1 \neq x_2$, then either $x_1 < x_2$ (so $f(x_1) < f(x_2)$) or $x_1 > x_2$ (so $f(x_1) > f(x_2)$); either way, $f(x_1) \neq f(x_2)$. The same argument applies to decreasing functions.

Frequently Asked Questions

What does "one-to-one" mean in plain language? A one-to-one function never sends two different inputs to the same output. Think of it as a strict pairing: each output value is matched to exactly one input value.

How is the horizontal line test different from the vertical line test? The vertical line test checks whether a curve represents a function at all (each input has at most one output). The horizontal line test checks whether a function is one-to-one (each output comes from at most one input). You apply the vertical line test first; only after that does it make sense to apply the horizontal line test.

Can I make any function one-to-one by restricting its domain? Yes, in principle. For example, $f(x) = x^2$ is not one-to-one on $\mathbb{R}$, but it becomes one-to-one on $[0, \infty)$ or on $(-\infty, 0]$. However, the restricted function is a different function from the original, because its domain is different.

Why does one-to-one matter for inverse functions? A function has an inverse if and only if it is one-to-one. If two different inputs $x_1 \neq x_2$ give the same output $y$, then we cannot define $f^{-1}(y)$ unambiguously: it would need to equal both $x_1$ and $x_2$, which is not allowed for a function.