One-to-One Function
One-to-One Function
A function for which every element of the range of the function corresponds to exactly one element of the domain. One-to-one is often written 1-1.
Note: y = f(x) is a function if it passes the vertical line test. It is a 1-1 function if it passes both the vertical line test and the horizontal line test. Another way of testing whether a function is 1-1 is given below.

Key Formula
A function f is one-to-one if and only if:f(a)=f(b)⟹a=b
Where:
- f = The function being tested for the one-to-one property
- a = Any element in the domain of f
- b = Any other element in the domain of f
Worked Example
Problem: Determine whether f(x) = 2x + 3 is a one-to-one function.
Step 1: Assume that f(a) = f(b) for two inputs a and b.
f(a)=f(b)
Step 2: Substitute the function rule for each side.
2a+3=2b+3
Step 3: Subtract 3 from both sides.
2a=2b
Step 4: Divide both sides by 2.
a=b
Step 5: Since f(a) = f(b) forces a = b, the function is one-to-one. You can also confirm this graphically: the line y = 2x + 3 passes the horizontal line test because every horizontal line crosses it at most once.
Answer: f(x) = 2x + 3 is a one-to-one function.
Another Example
This example shows a function that fails the one-to-one test and demonstrates the important technique of restricting the domain to make a function one-to-one.
Problem: Determine whether g(x) = x² is a one-to-one function (with domain all real numbers).
Step 1: Try to find two different inputs that produce the same output. Pick a = 3 and b = −3.
g(3)=32=9,g(−3)=(−3)2=9
Step 2: We found g(3) = g(−3) = 9, but 3 ≠ −3. This is a counterexample to the one-to-one condition.
f(a)=f(b) but a=b
Step 3: Graphically, the parabola y = x² fails the horizontal line test because the horizontal line y = 9 crosses it at two points: (3, 9) and (−3, 9).
Step 4: However, if you restrict the domain to x ≥ 0, the function becomes one-to-one. This is exactly what we do when defining the square root as the inverse of x².
g(x)=x2 for x≥0⟹g−1(x)=x
Answer: g(x) = x² is NOT one-to-one on all real numbers, but it IS one-to-one when the domain is restricted to x ≥ 0.
Frequently Asked Questions
How do you tell if a function is one-to-one from its graph?
Use the horizontal line test. If every horizontal line you draw crosses the graph at most once, the function is one-to-one. If any horizontal line crosses the graph two or more times, two different x-values share the same y-value, so the function is not one-to-one.
What is the difference between a one-to-one function and an onto function?
A one-to-one (injective) function guarantees that no two inputs map to the same output. An onto (surjective) function guarantees that every element in the codomain is actually an output for some input. A function that is both one-to-one and onto is called bijective, and it has a perfect two-way pairing between domain and codomain.
Why do one-to-one functions matter for inverse functions?
A function has an inverse if and only if it is one-to-one. When each output comes from exactly one input, you can reverse the process — swap inputs and outputs — and still have a valid function. If a function is not one-to-one, its inverse would map a single input to multiple outputs, which violates the definition of a function.
One-to-One (Injective) Function vs. Onto (Surjective) Function
| One-to-One (Injective) Function | Onto (Surjective) Function | |
|---|---|---|
| Definition | No two different inputs produce the same output | Every element of the codomain is an output of at least one input |
| Formal condition | f(a) = f(b) ⟹ a = b | For every y in the codomain, there exists x such that f(x) = y |
| Graphical test | Passes the horizontal line test | Every horizontal line at a codomain value crosses the graph at least once |
| Example | f(x) = 2x + 3 on all reals | f(x) = x³ from ℝ to ℝ (also one-to-one) |
| Counterexample | f(x) = x² on all reals (fails — two inputs give same output) | f(x) = x² from ℝ to ℝ (fails — negative outputs are never reached) |
Why It Matters
One-to-one functions are essential when you study inverse functions, which appear throughout algebra, trigonometry, and calculus. Understanding one-to-one also explains why inverse trig functions like arcsin exist only on restricted domains. In more advanced courses, the concept of injectivity is a foundation for topics such as function composition, cryptography, and linear transformations in linear algebra.
Common Mistakes
Mistake: Confusing 'function' with 'one-to-one function.' Students assume that passing the vertical line test is enough.
Correction: The vertical line test only confirms you have a function (each input gives one output). To be one-to-one, the function must ALSO pass the horizontal line test (each output comes from one input). These are two separate requirements.
Mistake: Concluding that f(a) = f(b) means a function is not one-to-one, without checking whether a ≠ b.
Correction: The one-to-one definition says: if f(a) = f(b), then a = b. You only have a violation when f(a) = f(b) AND a ≠ b. Finding f(3) = f(3) does not disprove one-to-one — you need two distinct inputs producing the same output.
Related Terms
- Function — A one-to-one function is a special type of function
- Domain — The set of inputs where the function is defined
- Range — The set of outputs; each value maps back to one input
- Horizontal Line Test — Graphical test to verify one-to-one property
- Vertical Line Test — Tests whether a graph is a function at all
- Element of a Set — Individual members of the domain or range
- Inverse of a Function — Exists only when the function is one-to-one
