If g∘f is onto then,

If g∘f is onto then,

  1. A.

    f and g must be onto

  2. B.

    f must be and g maybe onto

  3. C.

    f may be and g must be onto

  4. D.

    Neither is onto

Attempted by 197 students.

Show answer & explanation

Correct answer: C

Answer: f may be and g must be onto

Reason: Let f: A → B and g: B → C. If g∘f is onto C, then for every c in C there exists a in A with g(f(a)) = c. Set b = f(a). Then b is in B and g(b) = c, so every element of C has a preimage under g. Therefore g is onto.

The function f need not be onto. A concrete counterexample:

  • Take A = {1}, B = {1,2}, C = {x}.

  • Define f by f(1) = 1, so f is not onto B.

  • Define g by g(1) = x and g(2) = x, so g is onto C.

  • Then g∘f maps 1 to x, so g∘f is onto C even though f is not onto.

Therefore the correct conclusion is that the second function g must be onto, while the first function f may or may not be onto.

Notes on the other choices: Stating that both must be onto is false because f can fail to be onto; stating that f must be onto is false for the same reason; stating that neither is onto is false because g must be onto.

Explore the full course: Dsssb Tgt Computer Science Paper 2