One to One Functions in Mathematics
Last Updated :
07 May, 2025
A One-to-One function, also known as an Injective function, is a type of function defined over a domain and codomain that describes a specific type of relationship between them. In a One-to-One function, each element in the domain maps to a unique element in the codomain.
This article explores the concept of One to One Function or One-One Function in detail, including its definition and examples, which help you understand the concept with ease.
One-to-One Function Mathematical Definition
A function 'f' from a set 'A' to a set 'B' is one-to-one if no two elements in 'A' are mapped to the same element in 'B.'

Let's consider these two diagrams. For diagram A, we realize that 10 maps to 1, 20 maps to 2, and 30 maps to 3.
However for diagram B it is clear that 10 and 30 maps to 3 and then 20 maps to 1.
Since we have elements in the domain corresponding to distinct values in the each domain for diagram A it makes the function one-to-one, thus our diagram B is not one to one.
This can be expressed mathematically as
f(a) = f(b) ⇒ a = b
One-to-One Functions Example
Some examples of one-to-one functions are given below:
- Identity Function: The identity function is a simple example of a one-to-one function. It takes an input and returns the same value as the output. For any real number x, the identity function is defined as:
f(x) = x
Every distinct input x corresponds to a distinct output f(x), making it a one-to-one function.
- Linear Function: A linear function is one where the highest power of the variable is 1. For example:
f(x) = 2x + 3
This is a one-to-one function because no matter what value of x you choose, you will get a unique value for f(x).
- Square Function: The square function, defined on positive real numbers, f(x)= x2, is also a one-to-one function. For any positive real number x, the square value function returns a non-negative value, and different values of x will result in different values.
Let's prove one such example for a one-to-one function.
Example: Prove that the function f(x) = 1/(x+2), x≠2 is one-to-one.
Solution:
According one-to-one function we know that
f(a) = f(b)
replace a with x and x with b
f(a) = 1/(a+2) , f(b) = 1/(b+2)
⇒ 1/(a+2) = 1/(b+2)
cross multiply the above equation
1(b+2)=1(a+2)
b+2=a+2
⇒ b=a+2-2
∴ a=b
Now, since a = b the function is said to be one-to-one function.
Properties One-to-One Functions
Let's consider that f and g are two one-to-one functions, the properties are as follows:
- If f and g are both one-to-one, then f ∘ g follows injectivity.
- If g ∘ f is one-to-one, then function f is one-to-one, but function g may not be.
- f: X → Y is one-one, if and only if, given any functions g, h : P → X, whenever f ∘ g = f ∘ h, then g = h. In other words, one-one functions are exactly the monomorphisms in the category of sets.
- If f: X → Y is one-to-one and P is a subset of X, then f-1(f(A)) = P. Thus, P can be retrieved from its image f(P).
- If f: X → Y is one-to-one and P and Q are both subsets of X, then f(P ∩ Q) = f(P) ∩ f(Q).
- If both X and Y are limited with the same number of elements, then f: X → Y is one-to-one, if and only if f is a surjective or onto function.
One-to-One Function Graph
Let's see one of a graph representation of the one-to-one function

The above graph of the function f(x)= √x shows the graphical representation of a one-to-one function.
Horizontal Line Test
A function is one-to-one if each horizontal line does not intersect the graph at more that one point.

In the above example, it only intersect the horizontal line only at one point. So f(x) is one-to-one function which means that it has an inverse function.
Inverse of a one-to-one function
Let f be a one-to-one function with a domain A and Range B. Then the inverse of f is a function with domain B and Range A defined by f-1 (y) =x if and only if f(x) = y for any y in B.

Always remember a function has an inverse if and only if it is one-to-one. A function is one-to-one if the highest exponent is an odd number. But if the highest number is an even number or an absolute value this is not one-to-one function.
Example: f(x) = 3x + 2. Find the inverse of the function.
Solution:
write the function in y=f(x) form
⇒ y = 3x + 2
lets interchange y and x variables
⇒ x = 3y + 2
solve y in terms of x
⇒ x - 2=3y
divide the equation with 3
⇒ (x-2)/3=3y/3
⇒ y=(x-2)/3
∴ f-1(x)=(x-2)/3
One-to-One Function and Onto Function
The key differences between One-to-One and Onto Functions are listed in the following table:
Property | One-to-One (Injective) Function | Onto (Surjective) Function |
---|
Definition | A function in which no two different elements in the domain map to the same element in the codomain. In other words, each element in the domain maps to a unique element in the codomain. | A function in which every element in the codomain is mapped to by at least one element in the domain. In other words, the range of the function equals the entire codomain. |
---|
Symbolic Representation | f(x1) ≠ f(x2) if x1 ≠ x2 for all x1, x2 in the domain. | For every y in the codomain, there exists an x in the domain such that f(x) = y. |
---|
Graphical Representation | The graph of a one-to-one function never has a horizontal line that intersects it at more than one point. | The graph of an onto function may not cover every point on the codomain, but it covers every point that it can, meaning there are no "gaps" in the codomain. |
---|
Example | f(x) = 2x is one-to-one because no two distinct values of x produce the same output. | f(x) = √x is onto for non-negative real numbers as its codomain because all non-negative real numbers have a preimage in this function. |
---|
Inverse Function | A one-to-one function generally has an inverse function. | An onto function may or may not have an inverse function. |
---|
Cardinality | The cardinality of the domain and codomain can be equal or different for one-to-one functions. | The cardinality of the codomain is usually greater than or equal to the cardinality of the domain for onto functions. |
---|
The following illustration provides the clear difference between one-to-one and onto functions:

Read More,
Solved Problems on One-to-One Function
Let's solve some problems to illustrate one-to-one functions:
Question 1: Determine if the following function is one-to-one: f(x) = 3x - 1.
Solution:
To check if it's one-to-one, we need to show that no two distinct x-values map to the same y-value.
Suppose f(a) = f(b), where a ≠ b.
3a - 1 = 3b - 1
3a = 3b
a = b
Since the only way for f(a) = f(b) is when a = b, this function is indeed one-to-one.
Question 2: Determine if the following function is one-to-one: g(x) = x2
Solution:
We'll use the horizontal line test by graphing the function. If any horizontal line intersects the graph more than once, it's not one-to-one.
The graph of g(x) = x^2 is a parabola opening upwards. Any horizontal line only intersects the graph once, so this function is not one-to-one.
Practice Problems on One-to-One Functions
Question 1: Determine whether the following function is one-to-one:
- f(x) = 2x + 3
- g(x) = 3x2 - 1
- h(x) = 3√x
Question 2: Find a function that is one-to-one from the set of real numbers to the set of real numbers.
Question 3: Given the function g(x) = x2 + 1, determine if it is one-to-one on its entire domain.
Question 4: Consider the function h(x) = ex. Is it a one-to-one function?
Question 5: Find the inverse function of f(x) = 4x - 7 and determine its domain.
Question 6: Determine if the function p(x) = √x is one-to-one.
Question 7: Given q(x) = x/2, find the domain and range of the function.
Question 8: Check whether the function r(x) = sin (x) is one-to-one over the interval [0, π].
Question 9: Consider the function s(x) = |x|. Is it a one-to-one function?
Question 10: Determine if the function t(x) = 1/x is one-to-one and find its domain.
Similar Reads
Non-linear Components In electrical circuits, Non-linear Components are electronic devices that need an external power source to operate actively. Non-Linear Components are those that are changed with respect to the voltage and current. Elements that do not follow ohm's law are called Non-linear Components. Non-linear Co
11 min read
Spring Boot Tutorial Spring Boot is a Java framework that makes it easier to create and run Java applications. It simplifies the configuration and setup process, allowing developers to focus more on writing code for their applications. This Spring Boot Tutorial is a comprehensive guide that covers both basic and advance
10 min read
Class Diagram | Unified Modeling Language (UML) A UML class diagram is a visual tool that represents the structure of a system by showing its classes, attributes, methods, and the relationships between them. It helps everyone involved in a projectâlike developers and designersâunderstand how the system is organized and how its components interact
12 min read
Backpropagation in Neural Network Back Propagation is also known as "Backward Propagation of Errors" is a method used to train neural network . Its goal is to reduce the difference between the modelâs predicted output and the actual output by adjusting the weights and biases in the network.It works iteratively to adjust weights and
9 min read
3-Phase Inverter An inverter is a fundamental electrical device designed primarily for the conversion of direct current into alternating current . This versatile device , also known as a variable frequency drive , plays a vital role in a wide range of applications , including variable frequency drives and high power
13 min read
Polymorphism in Java Polymorphism in Java is one of the core concepts in object-oriented programming (OOP) that allows objects to behave differently based on their specific class type. The word polymorphism means having many forms, and it comes from the Greek words poly (many) and morph (forms), this means one entity ca
7 min read
CTE in SQL In SQL, a Common Table Expression (CTE) is an essential tool for simplifying complex queries and making them more readable. By defining temporary result sets that can be referenced multiple times, a CTE in SQL allows developers to break down complicated logic into manageable parts. CTEs help with hi
6 min read
What is Vacuum Circuit Breaker? A vacuum circuit breaker is a type of breaker that utilizes a vacuum as the medium to extinguish electrical arcs. Within this circuit breaker, there is a vacuum interrupter that houses the stationary and mobile contacts in a permanently sealed enclosure. When the contacts are separated in a high vac
13 min read
Python Variables In Python, variables are used to store data that can be referenced and manipulated during program execution. A variable is essentially a name that is assigned to a value. Unlike many other programming languages, Python variables do not require explicit declaration of type. The type of the variable i
6 min read
Spring Boot Interview Questions and Answers Spring Boot is a Java-based framework used to develop stand-alone, production-ready applications with minimal configuration. Introduced by Pivotal in 2014, it simplifies the development of Spring applications by offering embedded servers, auto-configuration, and fast startup. Many top companies, inc
15+ min read