How do you tell if a function is one-to-one?

A function is one-to-one (sometimes called injective) if every output value is paired with exactly one input value. You can tell if a function is one-to-one by checking if it passes the horizontal line test on a graph, or by proving algebraically that if f(a) = f(b), then a must equal b. Imagine a school where every student is assigned their own unique locker. If every locker belongs to exactly one student, the assignment is one-to-one. But if two students have to share the same locker, the one-to-one rule is broken. In math terms, a function already ensures that every x-value gives exactly one y-value. A one-to-one function adds a reverse rule: every y-value must come from exactly one x-value.

Understanding the Algebraic Definition

Algebraically, a function is one-to-one if we can assume that two outputs are equal, f(a) = f(b), and logically show that their inputs must also be equal, a = b. If you can find even a single case where two different inputs (like x = 2 and x = -2) give the exact same output (like y = 4), the function is not one-to-one. This is why linear functions with a non-zero slope are always one-to-one, while quadratic functions are generally not.

The Horizontal Line Test

The fastest way to check if a function is one-to-one is by looking at its graph and using the horizontal line test. Imagine drawing straight, flat horizontal lines across the graph. If any horizontal line touches the graph in more than one place, the function is not one-to-one. Touching the graph twice means two different x-values share the same y-value. If every possible horizontal line touches the graph at most once, congratulations: your function is one-to-one.

Where Students Slip Up

The most common mistake is confusing the vertical line test with the horizontal line test. Remember their different jobs: the vertical line test checks if a graph is a function at all, while the horizontal line test checks if a known function is one-to-one. Another frequent trap is ignoring domain restrictions. A parabola like f(x) = x^2 is not one-to-one on its own, but if your teacher restricts the domain to only positive numbers (x >= 0), it suddenly becomes one-to-one because we cut off the left half of the U-shape.

Worked through

Determine algebraically if the function f(x) = 3x + 5 is one-to-one.

To test this algebraically, we start by setting f(a) equal to f(b). This gives us the equation 3a + 5 = 3b + 5. Our goal is to solve this and see if it simplifies exactly to a = b. First, subtract 5 from both sides, which leaves 3a = 3b. Next, divide both sides by 3. This leaves a = b. Because starting with f(a) = f(b) forced us to conclude that a = b, we have proven that no two different inputs can share the same output. Therefore, f(x) = 3x + 5 is a one-to-one function.

Questions students ask

Ask about this topic

Where this comes from: OpenStax College Algebra, Chapter 3: Functions · Khan Academy, Unit: Functions (Inverse functions and one-to-one functions)

See also