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.
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.

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.
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.