Sets and functions: questions and answers

By Team Megalecture · Updated 22 Nov 2026

NUST NET (Engineering) · Maths · Numbers, sets and functions. A short explanation of the idea, the rules to remember, the mistake to avoid, a worked example and practice questions with answers.

Test this topic freeAll NUST NET (Engineering) topics

The idea

Set questions are counting questions. A Venn diagram shows the union A ∪ B (in A or B or both), the intersection A ∩ B (in both) and the complement A′ (not in A). When two groups overlap, the overlap is counted twice unless you subtract it once.

A function gives each input exactly one output. Its domain is the set of allowed inputs and its range is the set of outputs it actually produces. To find a domain, look for what must be avoided: a zero denominator, or a negative number under a square root.

A composite f∘g means g acts first, then f. An inverse undoes the function and exists only when the function is one-one.

Rules to remember

Common mistake

Working out f∘g in the wrong order. (f∘g)(x) means f(g(x)), so g is applied first; f(x) × g(x) and g(f(x)) are different things.

Worked example

If f(x) = 2x + 3 and (f∘g)(x) = 6x − 1, then g(x) is

  1. (f∘g)(x) = f(g(x)) = 2g(x) + 3.
  2. Set this equal to 6x − 1: 2g(x) + 3 = 6x − 1, so 2g(x) = 6x − 4.
  3. Divide by 2: g(x) = 3x − 2. Check: 2(3x − 2) + 3 = 6x − 1.

Answer: g(x) = 3x − 2

Practice questions

Try each one, then open the answer.

1. f(x) = 2x + 1 and g(x) = x2. The non-zero value of x for which (f∘g)(x) = (g∘f)(x) is

  1. A
    2
  2. B
    −2
  3. C
    −1/2
  4. D
    −4
Show answer

Answer: B. (f∘g)(x) = 2x2 + 1 and (g∘f)(x) = (2x + 1)2 = 4x2 + 4x + 1. Equating gives 2x2 + 4x = 0, so x = 0 or x = −2.

2. f(x) = x3 + (k − 2)x2 + 5x is an odd function for all real x. The value of k is

  1. A
    0
  2. B
    −2
  3. C
    5
  4. D
    2
Show answer

Answer: D. An odd polynomial has only odd powers of x, so the x2 term must vanish: k − 2 = 0 and k = 2. Check: f(−x) = −x3 − 5x = −f(x).

3. A set A has 128 subsets. The number of elements in A is

  1. A
    64
  2. B
    7
  3. C
    8
  4. D
    6
Show answer

Answer: B. A set with n elements has 2n subsets, and 27 = 128, so n = 7. Halving 128 to get 64 confuses subsets with elements.

More questions on this topic

Read the full notes

Keep going

← Complex numbersMatrices and determinants →All rules on one pageStuck? Ask a question