Open In App

Types of Functions

Last Updated : 10 Apr, 2025
Comments
Improve
Suggest changes
Like Article
Like
Report

Functions are defined as the relations which give a particular output for a particular input value. A function has a domain and codomain (range). f(x) usually denotes a function where x is the input of the function. In general, a function is written as y = f(x).

A function is a relation between two sets set A and set B. Such that every element of set A has an image in set B and no element in set A has more than one image in set B.

Let A and B be two nonempty sets. A function or mapping f from A to B is written as f: A → B is a rule by which each element a ∈ A is associated with a unique element b ∈ B.

Function Test

Domain, Codomain, and Range of a Function

The elements of set X are called the domain of f and the elements of set Y are called the codomain of f. The images of the elements of set X are called the range of function, which is always a subset of Y. The image given below demonstrates the domain, codomain, and range of the function.

Domain, Codomain, and Range of a Function

The image demonstrates the domain, co-domain, and range of the function. Remember the element which is mapped only will be counted in the range as shown in the image. The domain, codomain, and range of the above function are:

  • Domain = {a, b, c}
  • Codomain = {1, 2, 3, 4, 5}
  • Range = {1, 2, 3}

Learn more about Domain and Range.

Representation of Function

There are three different forms of representation of functions. The function needs to be represented to showcase the domain values and the relationship between them. The function can be represented with the help of algebraic form, graphical formats, and other roster form.

  • Algebraic Form: A function is usually denoted by the equation y = f(x) which connects the values on the y-axis.
  • Graphical Form: Functions are easy to understand if they are represented in a graphical form with the help of coordinate axes, which helps us to understand the changing behavior of the function if the function is increasing or decreasing.
  • Roster Form: Roster notation of a set is a simple mathematical representation of the set in mathematical form. In this notation, a function is represented with a set in mathematical form. In this notation, a function is represented with a set of points on its graph with the first and second element of domain and range respectively.

Types of Functions in Maths

An example of a simple function is f(x) = x3. In this function, f(x) takes the value of “x” and then cubes it to find the value of the function.
For example, if the value of x is taken to be 2, then the function gives 8 as output i.e. f(2) = 8.

Some other examples of functions are: 

  • f(x) = cos x,
  • f(x) = 5x2 + 9,
  • f(x) = 1/x3, etc.

There are several types of functions in maths. Some of the important types are:

  • One to One (Injective) function
  • Many to One function
  • Onto (Surjective) Function
  • Into Function

One to One (Injective) function

A function f: X → Y is said to be a one-to-one function if the images of distinct elements of X under f are distinct. Thus, f is one to one if f(x1) = f(x2)

  • Property: A function f: A → B is one-to-one if f(x1) = f(x2) implies x1 = x2, i.e., an image of a distinct element of A under f mapping (function) is distinct.
  • Condition to be One-to-One function: Every element of the domain has a single image with a codomain after mapping.

One to One (Injective) function

Learn more about One-to-One Functions.

Examples of One-to-One Functions

Some examples of one-one functions are:

  • f(x) = x (Identity function)
  • k(x) = 2x + 3 (Linear Polynomial)
  • g(x) = ex (Exponential function)
  • h(x) = √x​ (Square root function, defined for x ≥ 0)

Many to One Function

If the function is not one to one function, then it should be many to one function means every element of the domain has more than one image at codomain after mapping.

  • Property: One or more elements having the same image in the codomain
  • Condition to be Many to One function: One or more than one element in the domain having a single image in the codomain.

Many to One function

Learn more about Many-One Functions.

Examples of Many to One Function

Some of the most common examples of many-to-one functions are:

Onto (Surjective) Function

A function f: X → Y is said to be an onto function if every element of Y is an image of some element of set X under f, i.e. for every y ∈ Y there exists an element x in X such that f(x) = y.

Properties:

  • The range of functions should be equal to the codomain.
  • Every element of B is the image of some element of A.

Condition to be onto function: The range of function should be equal to the codomain.

Onto (Surjective) Function

As we see in the above two images, the range is equal to the codomain means that every element of the codomain is mapped with the element of the domain, as we know that elements that are mapped in the codomain are known as the range. So these are examples of the Onto function.

Learn more about Onto Functions.

Examples of Onto Functions

Some of the most common examples of onto functions are:

  • f(x) = x (Identity function)
  • g(x) = ex (Exponential function)
  • h(x) = sin(x) (Sine function within a limited domain, e.g., h: R→[−1,1])
  • k(x) = cos(x) (Cosine function within a limited domain, e.g., k : [0,π]→[−1,1])
  • m(x) = x3 (Cubic function)

Into Function

A function f: X → Y is said to be an into a function if there exists at least one element or more than one element in Y, which does not have any pre-images in X, which simply means that every element of the codomain is not mapped with elements of the domain.

Properties:

  • The Range of function is the proper subset of B
  • The Range of functions should not equal B, where B is the codomain.

Into Function

From the above image, we can see that every element of the codomain is not mapped with elements of the domain means the 10th element of the codomain is left unmapped. So this type of function is known as the Into function.

Examples of Into Functions

Some examples of functions you can consider are:

  • f(x) = sin(x) where f: R→[−1, 1] is not onto because it doesn't cover all values in the interval [−1, 1][−1, 1].
  • g(x) = x2 where g: R→R+ (positive real numbers) is not onto because it doesn't map to any negative real numbers.
  • h(x) = ex where h: R→(0,∞) is not onto because it doesn't map to zero.

Summary: Types of Functions

All types can be summarized in the following table:

Function TypeDefinitionExample
One-to-One (Injective)A function where each element of the domain maps to a unique element in the codomain.f(x) = 2x+3
Many-to-OneA function where multiple elements of the domain may map to the same element in the codomain.f(x) = x2
Onto (Surjective)A function where every element in the codomain is mapped to by at least one element in the domain.f(x) = ex, f : R→(0, ∞)
Into (Non-surjective)A function that does not cover the entire codomain; there are elements in the codomain that are not mapped to by any element in the domain.f(x) = sin(x), f:R→[−1, 1]

Related Reads,

Solved Examples of Types of Function

Example 1: Check whether the function f(x) = 2x + 3, is one-to-one or not if Domain = {1, 2, 1/2} and Co-domain = {5, 7, 4}.
Solution:

Putting 1, 2, 1/2 in place of x in f(x) = 2x + 3, we get

f(1) = 5,
f(2) = 7,
f(1/2) = 4

As, for every value of x we get a unique f(x) thus, we can conclude that our function f(x) is One to One.

Example 2: Check whether the function is one-to-one or not: f(x) = 3x - 2.
Solution:

To check whether a function is one to one or not, we have to check that elements of the domain have only a single pre-image in codomain or not. For checking, we can write the function as,

f(x1) = f(x2
3x1 - 2 = 3x2 - 2 
3x1 = 3x2 
x1 = x2  

Since both x1 =  x2 which means that elements of the domain having a single pre-image in its codomain. Hence the function f(x) = 3x - 2 is one to one function.

Example 3: Check whether the function is one-to-one or not: f(x) = x2 + 3.

Solution: 

To check whether the function is One to One or not, we will follow the same procedure. Now let's check, we can write the function as,

f(x1) = f(x2
(x1)2 + 3 = (x2)2 + 3
 (x1)2 = (x2)2  

Since (x1)2 = (x2)2 is not always true.

Hence the function f(x) = x2 + 3 is not one to one function

Example 4: If N: → N, f(x) = 2x + 1 then check whether the function is injective or not.
Solution:

In question N → N, where N belongs to Natural Number, which means that the domain and codomain of the function is a natural number. For checking whether the function is injective or not, we can write the functions as,

Let, f(x1) = f(x2)
2x1 + 1= 2x2 + 1
2x1 = 2x2 0
x1 = x2

Since x1 = x2, means all elements of the domain are mapped with a single element of the codomain. Hence function f(x) = 2x + 1 is Injective (One to One).

Example 5: f(x) = x2, check whether the function is Many to One or not.
Solution:

Domain = {1, -1, 2, -2}, let's put the elements of the domain in the function

f(1) = 12 = 1
f(-1) = (-1)2 = 1
f(2) = (2)2 = 4
f(-2) = (-2)2 = 4

Thus, we can see that more than one element of the domain have similar image after mapping. So this is Many to One function.

Example 6: If f(x) = 2x + 1 is defined on R:→ R. Then check whether the following function is Onto or not.
Solution: 

For checking the function is Onto or not, Let's first put the function f(x) equal to y

f(x) = y
y = 2x + 1
y - 1 = 2x
x = (y - 1) / 2

Now put the value of x in the function f(x), we get,

f((y - 1) / 2) = 2 × [(y - 1) / 2] +1

Taking LCM 2, we get

= [2(y - 1) + 2] / 2
= (2y - 2 + 2) / 2
= y

Since we get back y after putting the value of x in the function. Hence the given function f(x) = 2x + 1 is Onto function.

Example 7: If f: N → N is defined by f(x) = 3x + 1. Then prove that function f(x) is Surjective.
Solution:

To prove that the function is Surjective or not, firstly we put the function equal to y. Then find out the value of x and then put that value in the function. So let's start solving it.

Let f(x) = y
3x + 1 = y
3x = y - 1
x = (y - 1) / 3

Now put the value of x in the function f(x), we get

f((y - 1) / 3) = {3 (y - 1) / 3} + 1
= y - 1 + 1
= y

Since we get back y after putting the value of x in the function. Hence the given function f(x) = (3x + 1) is Onto function.

Example 8: If A = R - {3} and B = R - {1}. Consider the function f: A → B defined by f(x) = (x - 2)/(x - 3), for all x ∈ A. Then show that the function f is bijective.
Solution:

To show the function is bijective we have to prove the given function both One to One and Onto.

Let's first check for One to One:

Let x1, x2 ∈  A such that f(x1) = f(x2

Then, (x1 - 2) / (x1 - 3) = (x2 - 2) / (x2 - 3)
(x1 - 2) ( x2 - 3) = (x2 - 2) (x1 - 3)
x1 . x2 - 3x1 - 2x1 + 6 = x1 . x2 - 3x2 -2x1 + 6
-3x1 - 2x2 = -3x2 - 2x1
-3( x1 - x2) + 2( x1 - x2) = 0
-( x1 - x2) = 0
x1 - x2  = 0 
⇒ x1 = x2
Thus, f(x1) = f(x2) ⇒ x1 = x2, ∀ x1, x2  ∈ A
So, the function is a One to One

Now let us check for Onto:

Let y ∈ B = R - {1} be any arbitrary element.

Then, f(x) = y

⇒ (x - 2) / (x - 3) = y
⇒ x - 2 = xy - 3y
⇒ x - xy = 2 - 3y
⇒ x(1 - y) = 2 - 3y
⇒ x =  (2 - 3y) / (1 - y) or x = (3y - 2) / (y - 1)
Now put the value of x in the function f(x) 

f((3y - 2) / (y - 1)) = { (3y - 2) / (y - 1) } - 2 / { (3y - 2) / (y - 1) - 3 }
= (3y - 2 - 2y + 2) / (3y - 2 - 3y + 3)
= y

Hence f(x) is Onto function. Since we proved both One to One and Onto this implies that the function is Bijective.

Example 9: A = {1, 2, 3, 4}, B = {a, b, c, d} then the function is defined as f = {(1, a), (2, b), (3, c), (4, d)}. Check whether the function is One to One Onto or not.
Solution: 

To check whether the function is One to One Onto or not. We have to check for both one by one. 

Let's check for One to One:

As we know the condition for One to One that all the elements of the domain are having a single image in the codomain. As we see in the mapping that all the elements of set A are mapped with set B and each having a single image after mapping. 

So the function is One to One.

Now let's check for Onto:

As we know the condition for the function to be Onto is that, Range = Codomain means all the elements of codomain are mapped with domain elements, in this case, codomain will equal to the domain. As we see in the mapping that the condition of the function to be Onto is satisfied. 

So the function is Onto. 

Since we had proved that the function is both One to One and Onto. 

Hence function is One to One Onto (Bijective).

Example 10: A = {1, 2, 3, 4}, B = {a, b, c, d}. The function is defined as f = {(1, a), (2, b), (3, c), (4, c)}. Check whether the function is Many to One Into or not.
Solution:

To check the function is Many to One Into or not. We have to check for both one by one.

Let's first check for Many to One function:

As we know the condition for Many to One function is that more than one element of domain should have more same image in codomain. From the above mapping we can see that the elements of A {3, 4 } are having same image in B { c }, so the function is Many to One.

Now let's check for Into function:

As we know the condition for Into function is that the Range of function should be the subset of codomain and also not equal to codomain. Let's check both the conditions are satisfied or not.

  • Range of function = {a, b, c}
  • Codomain of function = {a, b, c, d}

Range of function ≠ Codomain of function

As we check that the range of function is not equal to codomain of the function. Hence we can say that the function is Into function. As we prove that the function is Many to One and Into. 

Hence the function is Many to One Into.

Suggested Quiz
10 Questions

Which of the following is not a type of function?

  • A

    One-to-one function

  • B

    Onto function

  • C

    Objective function

  • D

    Bijective function

Explanation:
  • One-to-one function (Injective): Each element in the domain maps to a unique element in the codomain.
  • Onto function (Surjective): Every element in the codomain is mapped by at least one element from the domain.
  • Bijective function: A function that is both one-to-one and onto.
  • Objective function: This is not a type of function in mathematics; it refers to a function used in optimization problems.

Which of the following statements about functions is not correct?

  • A

    A one-to-one function maps each element of the domain to a unique element in the range.

  • B

    An onto function maps every element of the range to at least one element in the domain.

  • C

    A bijective function is both one-to-one and onto.

  • D

    A injective function can have multiple elements in the range corresponding to the same element in the domain.

Explanation:

An injective function (also known as a one-to-one function) means that each element in the domain maps to a unique element in the range, with no repetitions in the range. So, no two different elements of the domain can map to the same element in the range.

If f(x) = x2 − 2x + 3, then f(x) is:

  • A

    Odd

  • B

    Even

  • C

    Neither Odd or Even

  • D

    Periodic

Explanation:

f(−x) = (−x)2 − 2(−x) + 3 = x2 + 2x + 3, which is not equal to f(x) or −f(x). Hence, f(x) is neither odd nor even.

If f: R → R, then f(x) = |x| is

  • A

    One-one onto

  • B

    Many-one onto

  • C

    One-to-one but not onto

  • D

    None of These

Explanation:

for |x|, f(-1) = f(1) = 1

Thus, the function is Many-one.

Also, as f: R → R, but for negative values in codomain there is no pre-image in the domain. Thus, function is not onto.

Which of the four statements given below is different from others?

  • A

    f: A → B

  • B

    f: x → f(x)

  • C

    f is a mapping of A into B

  • D

    f is a function of A into B

Explanation:
  • f: A → B maps from A to a codomain B, which may contain more elements than the actual outputs.
  • f: x → f(x) maps from x to the range f(x), which is the set of all possible outputs of f, and is a subset of B (if B is larger than f(X)).

Also, "f is a mapping of A into B" and "f is a function of A into B" is the same as f: A → B.

The function f:R→R defined by f(x)=(x−1)|(x−2)(x−3)| is

  • A

    One-one but not onto

  • B

    Onto but not one-one

  • C

    Both one-one and onto

  • D

    Neither one-one nor onto

Explanation:

Given: f(x) = (x − 1)|(x − 2)(x − 3)|

for x = 1, 2 and 3, f(x) = 0, thus function is many-one.

For x > 3, f(x) = (x − 1)(x − 2)(x − 3) = x3 - 6x2 + 11x - x - 6 (which is an increasing function)

For x < 1, f(x) = (x − 1)(x − 2)(x − 3) [as (x - 2) and (x - 3) both are negative, thus overall value is positive]

As polynomial function have range and domain in all real numbers.

For given function for any y there is always a pre-image in real numbers, thus function is onto.

Function f: R → R, f(x) = x2 + x is

  • A

    One-one onto

  • B

    One-one into

  • C

    Many-one onto

  • D

    Many-one into

Explanation:

For function, f: R → R defined as f(x) = x2 + x,

As, f(0) = f(-1), thus the function is many one.

Consider, f(x) = -1

x2 + x = -1

⇒ x2 + x + 1 = 0

D = b2 - 4ac = 12 - 4 × 1 × 1 = 1 - 4 = -3 < 0

So, there are no real solution for this equation. This means for f(x) = -1 there is no value of x in domain.

Thus, function is into.

Let f: N → N defined by f(x) = x2 + x + 1, x ∈ N, then f is

  • A

    One-one onto

  • B

    Many-one onto

  • C

    One-one but not onto

  • D

    None of These

Explanation:

Given: f(x) = x2 + x + 1, x ∈ N

Let x, y ∈ N such that f(x) = f(y)

⇒ x2 + x + 1 = y2 + y + 1

⇒ x2 - y2 + x - y = 0

⇒ (x - y)(x + y + 1) = 0

⇒ x = y or x = -y - 1 (which is not possible because x ∈ N)

Thus, f(x) is one-one.

For onto,

f(1) = 3, f(2) = 7, f(3) = 13, f(4) = 21, . .

Here, we can clearly see this function is increasing in value. So, there are gaps in the codomain for which there is no natural number in domain.

Thus, function is not onto.

f(x) =x + √(x2) is a function from R → R , then f(x) is

  • A

    Injective

  • B

    Surjective

  • C

    Bijective

  • D

    None of These

Explanation:

Given: f(x) =x + √(x2) = x + |x|

f(-1) = f(-2) = f(-3) = . . . = 0

Thus, function is not injective.

Also, for x < 0, f(x) = -k + k = 0 (where k < 0)

Therefore, there is no pre image in domain for f(x) = -1 or any other number.

Thus, for R → R function is also not surjecitve.

As function is neither injective nor subjective, thus function is also not bijective.

If f:[0, ∞)→[0, ∞) and f(x) = x/(1 + x), then f is

  • A

    One-one and onto

  • B

    One-one but not onto

  • C

    Onto but not one-one

  • D

    Neither one-one nor onto

Explanation:

Given: f(x) = x/(1 + x)

Let x, y ∈ [0, ∞) such that f(x) = f(y)

⇒ x/(1 + x) = y/(1 + y)

⇒ x + xy = y + xy

⇒ x = y

Therefore, function is one-one.

For f(x) = 1,

⇒ x/(x + 1) = 1,

⇒ x = x + 1

⇒ 0 = 1 (which is not possible)

Thus, for f(x) = 1, there is no pre image in the domain.


Quiz Completed Successfully
Your Score :   2/10
Accuracy :  0%
Login to View Explanation
1/10 1/10 < Previous Next >

Next Article

Similar Reads