Let g: A -> B and f: B -> C be functions. Let f ∘ g be onto. Is both f and g necessarily onto?

I think that if f ∘ g is onto, then f is onto, but not necessarily g. Correct?

Yes, you are correct. If the composition of functions f ∘ g is onto, then it implies that f is onto, but it does not necessarily imply that g is onto.

To understand why this is the case, let's break down the definition of an onto function. A function f: X -> Y is onto (also called surjective) if and only if for every element y in the codomain Y, there exists an element x in the domain X such that f(x) = y. In other words, every element in the codomain Y is mapped onto by at least one element in the domain X.

Now, if we have two functions g: A -> B and f: B -> C, and we consider their composition f ∘ g, it means that for every element a in the domain A, we can find an element c in the codomain C such that (f ∘ g)(a) = c.

Since (f ∘ g)(a) = f(g(a)), this implies that for every element a in the domain A, there exists an element b = g(a) in the intermediate codomain B, such that f(b) = c. This demonstrates that every element in the intermediate codomain B is mapped onto by at least one element in the domain A.

Therefore, if f ∘ g is onto, it implies that f is onto because it covers the entire codomain C. However, there is no guarantee that g is onto because it may not cover the entire codomain B. It is possible for g to map multiple elements in the domain A to the same element in B, thus leaving some elements in B uncovered.

In conclusion, if f ∘ g is onto, then f is onto, but g may or may not be onto.