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 ) x 1 = x 2
Equivalent condition x 1 x 2 f ( x 1 ) f ( x 2 )
Horizontal line test Every horizontal line meets the graph at most once
Monotonic 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 ) = 2 x + 3 produces a distinct output for every input. Such functions are called one-to-one (or injective) functions.

A function f : A B is one-to-one (or an injection) if for all x 1 , x 2 in A :

Equivalently, whenever x 1 x 2 in A :

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 ) = m x + b ( m 0 ). Is f a one-to-one function?

Solution Method 1 (algebraic): If m x 1 + b = m x 2 + b , then m x 1 = m x 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 .
Restricting the domain: Although f is not one-to-one on all of , if we restrict to x 0 , the function f : [ 0 , ) with f ( x ) = x 2 + 1 passes the horizontal line test and becomes one-to-one. (Similarly, the restriction to x 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 , ) makes it one-to-one: each horizontal line meets the graph at most once.

Let f : { 0 } , 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 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) No
f ( x ) = x n ( n odd) Yes
f ( x ) = x n ( n even) [ 0 , ) Yes
f ( x ) = x n ( n odd) Yes
f ( x ) = 1 / x n ( n even) { 0 } No
f ( x ) = 1 / x n ( n odd) { 0 } Yes

Every monotonic function is one-to-one. If f is increasing and x 1 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 ) 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 , but it becomes one-to-one on [ 0 , ) or on ( , 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 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.