Types of Functions

One-to-one function or one–one function

A function f: A→B where A,B are two non-empty sets is called a one-to-one function if no two distinct
elements of A have the same image in B. That is, f: A→B is a one-to-one (or one–one) function
if and only if (i f f).

x1, x2∈A and x1≠ x2 then f(x1) ≠f(x2) or

  if f(x1) = f(x2) x1= x2

Example 1

f = {(a,x), (b,y), (c,z)}

is a one–one function.

Example 2

Let f: R→R be defined by f(x) = x2. Is f one–one?

Consider f(1) = (1)2

= 1

f(-1) = (-1)2 = 1

f(x1) = f(x2) = 1

But x1≠ x2

1 ≠-1

So f is not a one–one function.

A one–one function or one-to-one function is also called an injection.

Onto function

A function f: A→B, A,B are non-empty sets, is called an onto function if f(A)=B. That is f is onto
if every element of the

codomain B is the image of at least one element of the domain A.

f: A→B is onto if and only if (iff) for every y ∈B there exists at least one x∈ A such that f(x) = y.

Example 3

Let f: {a, b, c} →{1,2,3} such that f(a) = 3, f(b) = 2, f(c) = 1.

f is an onto function, since each element of {1,2,3} is an image of an element of {a, b, c}.

Example 4

Let f: {2, 4, 7} →{p, q, r}

such that f(2) = q, f(4) = r, f(7)= r

f is not onto as p is not the image of any element of {2, 4, 7}

Example 5

Let f: N→ {-1, 1} defined by

f(n) = 1 if f is odd,

= -1 if n is even.

f is onto.

Example 6

Let f: R→R be defined by f(x) = 3x-5. Show that f is onto.

Solution:

Let y = f(x) = 3x - 5

y = 3x - 5

y + 5 = 3x

For every y ∈R there is an x ∈R

such that  

An onto function is also called a surjection.

One–one and onto functions

A function f: A→B, A,B are non-empty, is called a one–one and onto
function if it is both one–one and onto. This type of function is also called a bijection.

Example 7

If f = { (p,1), (q,2), (r,3) }

f is one–one and onto

Since f (p) = 1

f(q) = 2

f(r) = 3

For every element of {1,2,3} is the image of element of {p,q,r}.

So f is onto.

Also, f is one–one since two distinct elements of {p,q,r} have two distinct images in {1,2,3}.

Example 8

Let f: R →R be defined by f(x) = 2x + 3

f is a one–one and onto function.

Consider -1≠ 1

f(-1) ≠f(1)

as 2 (-1) +3 ≠2 * 1+3

-2+3 ≠2+3

1 ≠5

Let y = f(x) = 2x + 3

y - 3 = 2x

So for every y ∈R there exists an x ∈R such that

So f is onto.

Example 9

Let f: R→R be defined by f (x) = x2 - 1

Consider f (2) = 22 -1

= 4-1

= 3.

f(-2) = (-2)2-1

= 4-1

= 3

f(2) = f(-2)

But 2 ≠-2

f is not one–one.

So f is not a bijection.

Try these questions

  1. State if the following functions are one-one

    a.  f1(x) = x2 f1: R→ R

    b.  f2(x) = -3x f2: R→ R

    Solutions:

    a.  f1 : R →R

    f1(x) = x2

    f1is not One–One since

    f1(-2) = (-2)2

    = 4

    f1(2) = (2)2

    = 4

    f1(-2) = f1(2)

    = 4

    but -2 ≠2

    b.  f2: R →R

    f2(x) = -3x

    f2(x1) ≠ f(x2)

    -3x1 ≠-3x2

    x1 ≠x2

    So f2 is one–one.

  2. State if the following functions are onto

    g1(x) = 2x3 g1: R→ R

    g3: Z→ Z defined by g3 (x) = x-1

    Solutions:


    a.  g1: R→ R

    g1(x) = 2x3

    Let y = g1 (x) = 2x3

    y = 2x3

    y/2 = x3

      g1 is onto.


    b.  g3: Z→ Z g3(x) = x-1

    g3is an onto function since g3 (Z) = Z.

    Or

    for every x ∈ Z there exists a y ∈ Z such that g(x) = y.

  3. State if the following functions are bijections. (One–One and onto functions).


    a.   f1 = {(a,-1), (b,-2), (c,-3), (d, -4)}

    f2 : R→ R defined by f2(x) = 4x-1

    Solutions:


    a.  f1 = {(a,-1), (b,-2), (c,-3), (d,(-4)}

    f1 is One–One since

    -1 ≠-2

       f1(a) ≠f1(b)

       a≠ b

    f1 is onto as every element of {a,b,c,d} has an image in {-1,-2,-3,-4}.

       f1 is a bijection.


    b.  f2 : R→ R where f2(x) = 4x-1

    f2 is One–One since

    f2(x1) = f2(x2)

           On canceling like terms

         x1 = x2

    f2 is onto since for every element x∈R there exists an element y∈ R such that

    f(x) = y.

    f2 is a bijection.

  4. Find the inverse functions (if they exist) of the following.

    a.   f: R→ R f | x | = 2x2-1

    f: R- {3} →R - {1} defined by f(x) =

    Solutions:

    a.  f: R→ R f (x) = 2x2-1

    f is not One–One as

    f(-1) = 2 - 1

    = 1

    f(1) = 2 - 1

    = 1

    So    f(-1) = f(1)

    But -1 ≠1

      f-1 does not exist.


    b.   f: R- {3} →R - {1} defined by f(x) =

    f is One–One

    f is onto

      f-1 exists.

    let y = f(x) =

    y =   

    y(x-3) = (x + 3)

    yx-3y = x+3

    yx - x = 3 + 3

    x(y-1)= 3(y+1)

    x =  

    x=f--1(y) =   

    Or f--1(x) =