Introduction to Functions

A function 'f' from a set A to a set B, denoted f:ABf: A \to B, is a special type of relation where every element in set A (the domain) is associated with exactly one element in set B (the codomain). The set of all outputs is called the range.

We can classify functions based on how the elements of the domain are mapped to the elements of the codomain.

1. One-one Function (Injection)

A function f:ABf: A \to B is one-one (or injective) if distinct elements in the domain A have distinct images in the codomain B.

For every x1,x2A,f(x1)=f(x2)    x1=x2.\text{For every } x_1, x_2 \in A, f(x_1) = f(x_2) \implies x_1 = x_2.

Alternatively, if x1x2x_1 \ne x_2, then f(x1)f(x2)f(x_1) \ne f(x_2).

  • Graphical Test (Horizontal Line Test): A function is one-one if and only if no horizontal line intersects its graph more than once.
  • Example: f(x)=2x+1f(x) = 2x+1 is a one-one function. If f(x1)=f(x2)f(x_1) = f(x_2), then 2x1+1=2x2+12x_1+1 = 2x_2+1, which implies x1=x2x_1=x_2.
  • Non-Example: f(x)=x2f(x) = x^2 is not one-one because f(2)=4f(-2) = 4 and f(2)=4f(2) = 4. Different inputs (-2 and 2) have the same output.

2. Many-one Function

A function f:ABf: A \to B is many-one if it is not one-one. This means there are at least two different elements in the domain A that have the same image in the codomain B.

  • Example: The function f(x)=cosxf(x) = \cos x is a many-one function because cos(0)=1\cos(0) = 1 and cos(2π)=1\cos(2\pi) = 1.

3. Onto Function (Surjection)

A function f:ABf: A \to B is onto (or surjective) if every element in the codomain B is the image of at least one element in the domain A. In other words, the range of the function is equal to its codomain.

Range of f=B\text{Range of } f = B

  • Example: Let f:RRf: \mathbb{R} \to \mathbb{R} be defined by f(x)=x+1f(x) = x+1. For any 'y' in the codomain R\mathbb{R}, we can find an x=y1x = y-1 in the domain such that f(x)=yf(x)=y. Thus, the range is R\mathbb{R}, and the function is onto.
  • Non-Example: Let f:RRf: \mathbb{R} \to \mathbb{R} be defined by f(x)=x2f(x) = x^2. The range of this function is [0,)[0, \infty), which is a proper subset of the codomain R\mathbb{R}. For instance, there is no real number x for which f(x)=1f(x) = -1. Therefore, the function is not onto.

4. Into Function

A function is an into function if it is not onto. This means there is at least one element in the codomain that is not the image of any element in the domain.

  • Example: The function f(x)=x2f(x) = x^2 from R\mathbb{R} to R\mathbb{R} is an into function.

5. Bijective Function (One-one and Onto)

A function is bijective if it is both one-one (injective) and onto (surjective). Bijective functions are also known as one-to-one correspondences.

  • Importance: A function has an inverse if and only if it is bijective.
  • Example: The function f:RRf: \mathbb{R} \to \mathbb{R} defined by f(x)=2x+1f(x) = 2x+1 is bijective. It is one-one (as shown before) and onto (for any yRy \in \mathbb{R}, we can find x=(y1)/2Rx=(y-1)/2 \in \mathbb{R}).

Example 1: Checking One-one (Injective)

Question: Show that the function f:RRf: \mathbb{R} \to \mathbb{R} defined by f(x)=x3f(x)=x^3 is one-one.

Explanation: A function is one-one (or injective) if different inputs always produce different outputs. To prove this algebraically, we assume f(x1)=f(x2)f(x_1) = f(x_2) and show that this necessarily implies x1=x2x_1 = x_2.

  1. Assume f(x1)=f(x2)f(x_1) = f(x_2): For any x1,x2Rx_1, x_2 \in \mathbb{R}, let f(x1)=f(x2)f(x_1) = f(x_2). This gives us x13=x23x_1^3 = x_2^3.

  2. Solve for x1x_1: Taking the cube root of both sides, we get x133=x233\sqrt[3]{x_1^3} = \sqrt[3]{x_2^3}, which simplifies to x1=x2x_1 = x_2.

  3. Conclusion: Since our assumption f(x1)=f(x2)f(x_1) = f(x_2) leads directly to the conclusion x1=x2x_1 = x_2, the function is one-one.

    Graphically, this function passes the Horizontal Line Test, as any horizontal line will intersect the graph of y=x3y=x^3 at most once.

Example 2: Checking Onto (Surjective)

Question: Show that the function f:RRf: \mathbb{R} \to \mathbb{R} defined by f(x)=x3f(x)=x^3 is onto.

Explanation: A function is onto (or surjective) if its range is equal to its codomain. This means that for any element yy in the codomain, there is at least one element xx in the domain (a pre-image) such that f(x)=yf(x)=y.

  1. Set f(x)=yf(x) = y: Let yy be an arbitrary element in the codomain R\mathbb{R}. We set y=f(x)y = f(x), which gives us y=x3y=x^3.
  2. Solve for xx in terms of yy: To find the pre-image, we solve for xx: x=y3x = \sqrt[3]{y}.
  3. Check if the pre-image is valid: For any real number yy (positive, negative, or zero), its real cube root, x=y3x = \sqrt[3]{y}, is also a well-defined real number. This value of xx belongs to the domain R\mathbb{R}.
  4. Conclusion: Since for every yy in the codomain, we found a pre-image xx in the domain, the function is onto.

Example 3: Many-one and Into Function

Question: Let f:ZZf: \mathbb{Z} \to \mathbb{Z} be defined by f(x)=x2f(x)=x^2. Classify the function.

Explanation: 1. Checking for One-one / Many-one: A function is one-one if different inputs give different outputs. Let's test two different inputs.

  • Let x1=2x_1 = -2 and x2=2x_2 = 2. Clearly, x1x2x_1 \neq x_2.
  • f(x1)=f(2)=(2)2=4f(x_1) = f(-2) = (-2)^2 = 4.
  • f(x2)=f(2)=22=4f(x_2) = f(2) = 2^2 = 4. Since different inputs (-2 and 2) produce the same output (4), the function is many-one.

2. Checking for Onto / Into: A function is onto if its range equals its codomain.

  • Codomain: The codomain is given as the set of all integers, Z={...,2,1,0,1,2,...}\mathbb{Z} = \{..., -2, -1, 0, 1, 2, ...\}
  • Range: The range is the set of all possible outputs. Since f(x)=x2f(x)=x^2, the outputs are all perfect squares: Range = {0,1,4,9,16,...}\{0, 1, 4, 9, 16, ...\} The range is a proper subset of the codomain. For example, the number 2 is in the codomain, but there is no integer xx such that x2=2x^2=2. Therefore, 2 has no pre-image.

Since the range is not equal to the codomain, the function is into.

Conclusion: The function is many-one and into.

Example 4: Bijective Function

Question: Is the function f:R{3}R{1}f: \mathbb{R}-\{3\} \to \mathbb{R}-\{1\} defined by f(x)=x2x3f(x) = \frac{x-2}{x-3} bijective?

Explanation: A function is bijective if it is both one-one (injective) and onto (surjective).

1. Check for One-one:

Assume f(x1)=f(x2)f(x_1) = f(x_2) for x1,x2x_1, x_2 in the domain.

x12x13=x22x23\frac{x_1-2}{x_1-3} = \frac{x_2-2}{x_2-3}

Cross-multiply: (x12)(x23)=(x22)(x13)(x_1-2)(x_2-3) = (x_2-2)(x_1-3)

x1x23x12x2+6=x1x23x22x1+6x_1x_2 - 3x_1 - 2x_2 + 6 = x_1x_2 - 3x_2 - 2x_1 + 6

3x12x2=3x22x1-3x_1 - 2x_2 = -3x_2 - 2x_1

x1=x2    x1=x2-x_1 = -x_2 \implies x_1 = x_2.

Since f(x1)=f(x2)f(x_1)=f(x_2) implies x1=x2x_1=x_2, the function is one-one.

2. Check for Onto:

Let yy be an arbitrary element in the codomain R{1}\mathbb{R}-\{1\}. We set y=f(x)y=f(x) and solve for xx.

y=x2x3    y(x3)=x2    xy3y=x2y = \frac{x-2}{x-3} \implies y(x-3) = x-2 \implies xy - 3y = x - 2

xyx=3y2    x(y1)=3y2    x=3y2y1xy - x = 3y - 2 \implies x(y-1) = 3y-2 \implies x = \frac{3y-2}{y-1}.

For any yy in the codomain, we can find a corresponding xx. Since the codomain is R{1}\mathbb{R}-\{1\}, the denominator y1y-1 will never be zero, so a valid xx exists for every yy. The function is onto.

Conclusion: Since the function is both one-one and onto, it is bijective.

Example 5: Modulus Function

Question: Classify the function f:RRf: \mathbb{R} \to \mathbb{R} defined by f(x)=xf(x) = |x|.

Explanation: 1. Check for One-one / Many-one: Let's test two different inputs, x1=1x_1 = -1 and x2=1x_2 = 1. f(1)=1=1f(-1) = |-1| = 1. f(1)=1=1f(1) = |1| = 1. Since different inputs produce the same output, the function is many-one.

2. Check for Onto / Into:

  • Codomain: The codomain is all real numbers, R\mathbb{R}.
  • Range: The range of the modulus function is the set of all non-negative real numbers, [0,)[0, \infty). Since the range is not equal to the codomain (e.g., -1 is in the codomain but has no pre-image), the function is into.

Conclusion: The function is many-one and into.

Example 6: Signum Function

Question: Classify the function f:RZf: \mathbb{R} \to \mathbb{Z} defined by f(x)=sgn(x)f(x) = sgn(x).

Explanation: First, recall the definition of the Signum function: sgn(x)={1,x<0 0,x=0 1,x>0sgn(x) = \begin{cases} -1, & x < 0 \ 0, & x=0 \ 1, & x > 0 \end{cases}

1. Check for One-one / Many-one: Let's test two different positive inputs, x1=2x_1=2 and x2=3x_2=3.

f(2)=1f(2) = 1.

f(3)=1f(3) = 1.

Since many different inputs map to the same output (all positive numbers map to 1), the function is many-one.

2. Check for Onto / Into:

  • Codomain: The codomain is the set of all integers, Z\mathbb{Z}.
  • Range: The range is the set of all possible outputs, which is just {1,0,1}\{-1, 0, 1\}.

Since the range is a proper subset of the codomain (e.g., the integer 2 is in the codomain but has no pre-image), the function is into.

Conclusion: The function is many-one and into.

Example 7: One-one but not Onto

Question: Let f:NNf: \mathbb{N} \to \mathbb{N} be defined by f(n)=n+1f(n) = n+1. Classify the function.

Explanation: The domain and codomain are the set of natural numbers N={1,2,3,...}\mathbb{N} = \{1, 2, 3, ...\}.

1. Check for One-one: Assume f(n1)=f(n2)f(n_1) = f(n_2) for n1,n2Nn_1, n_2 \in \mathbb{N}.

n1+1=n2+1    n1=n2n_1+1 = n_2+1 \implies n_1=n_2.

Since f(n1)=f(n2)f(n_1)=f(n_2) implies n1=n2n_1=n_2, the function is one-one.

2. Check for Onto:

  • Codomain: N={1,2,3,4,...}\mathbb{N} = \{1, 2, 3, 4, ...\}.
  • Range: The set of outputs is f(1)=2,f(2)=3,f(3)=4,...f(1)=2, f(2)=3, f(3)=4, .... So, the range is {2,3,4,...}\{2, 3, 4, ...\}.

The range is not equal to the codomain. Specifically, the number 1 is in the codomain but is not in the range; it has no pre-image in the domain N\mathbb{N} (since n+1=1n+1=1 would require n=0n=0, which is not a natural number).

Therefore, the function is not onto (it is an into function).

Conclusion: The function is one-one and into.

Example 8: Many-one and Onto

Question: Let f:R[0,)f: \mathbb{R} \to [0, \infty) be defined by f(x)=x2f(x) = x^2. Classify the function.

Explanation: This question is similar to Example 3, but the codomain has been changed.

1. Check for One-one / Many-one: The domain is still R\mathbb{R}. As before, different inputs like x1=2x_1=-2 and x2=2x_2=2 give the same output f(2)=f(2)=4f(-2)=f(2)=4. Therefore, the function is many-one.

2. Check for Onto / Into:

  • Codomain: The codomain is explicitly given as the set of all non-negative real numbers, [0,)[0, \infty).
  • Range: The range of the function f(x)=x2f(x)=x^2 is also the set of all non-negative real numbers, [0,)[0, \infty).

Since the range is equal to the codomain, the function is onto.

Conclusion: The function is many-one and onto.

Example 9: Proving a function is NOT one-one

Question: Show that f(x)=cosxf(x) = \cos x from RR\mathbb{R} \to \mathbb{R} is not one-one.

Explanation: To prove a function is not one-one, we only need to find a single counter-example: a pair of distinct inputs, x1x_1 and x2x_2, such that their outputs are the same, i.e., f(x1)=f(x2)f(x_1) = f(x_2).

  1. Choose two different inputs: Let's choose x1=0x_1=0 and x2=2πx_2=2\pi. Clearly, x1x2x_1 \ne x_2.

  2. Calculate their outputs: f(x1)=cos(0)=1f(x_1) = \cos(0) = 1.

    f(x2)=cos(2π)=1f(x_2) = \cos(2\pi) = 1.

  3. Conclusion: We have found two different inputs, 0 and 2π2\pi, that produce the same output, 1. Therefore, the function f(x)=cosxf(x)=\cos x is not one-one (it is many-one). Due to its periodic nature, there are infinitely many such examples.

Example 10: Using Derivatives to Check Injectivity

Question: Show that f:RRf: \mathbb{R} \to \mathbb{R} given by f(x)=x33x2+6x5f(x)=x^3-3x^2+6x-5 is injective.

Explanation: A powerful method for checking injectivity (one-one) of a differentiable function is to analyze its derivative, f(x)f'(x). If the derivative is always positive or always negative across the entire domain, the function is strictly monotonic (always increasing or always decreasing), which guarantees it is one-one.

  1. Find the derivative: f(x)=ddx(x33x2+6x5)=3x26x+6f'(x) = \frac{d}{dx}(x^3-3x^2+6x-5) = 3x^2-6x+6

  2. Analyze the sign of the derivative: To determine if f(x)f'(x) is always positive or negative, we can try to factor it or check its discriminant. Let's complete the square. f(x)=3(x22x+2)f'(x) = 3(x^2-2x+2) f(x)=3((x22x+1)+1)f'(x) = 3((x^2-2x+1) + 1) f(x)=3((x1)2+1)f'(x) = 3((x-1)^2+1)

  3. Conclusion: The term (x1)2(x-1)^2 is always greater than or equal to 0. Therefore, (x1)2+1(x-1)^2+1 is always greater than or equal to 1.

    This means f(x)=3((x1)2+1)f'(x) = 3((x-1)^2+1) is always positive for all xRx \in \mathbb{R}.

    Since the derivative is always positive, the function is strictly increasing, and therefore it is injective (one-one).