Answer / Explanation
The question is incomplete. It can be found in search engines. However, kindly find the complete question below.
Question
(1) Give an example of functions f : A −→ B and g : B −→ C such that g ◦ f is injective but g is not injective.
(2) Suppose that f : A −→ B and g : B −→ C are functions and that g ◦ f is surjective. Is it true that f must be surjective? Is it true that g must be surjective? Justify your answers with either a counterexample or a proof
Answer
(1) There are lots of correct answers. You can set A = {1}, B = {2, 3} and C = {4}. Then define f : A −→ B by f(1) = 2 and g : B −→ C by g(2) = 4 and g(3) = 4. Then g is not injective (since both 2, 3 7→ 4) but g ◦ f is injective. Here’s another correct answer using more familiar functions.
Let f : R≥0 −→ R be given by f(x) = √
x. Let g : R −→ R be given by g(x) = x , 2 . Then g is not injective (since g(1) = g(−1)) but g ◦ f : R≥0 −→ R is injective since it sends x 7→ x.
NOTE: Lots of groups did some variant of the second example. I took off points if they didn’t specify the domain and codomain though. Note that the codomain of f must equal the domain of
g for g ◦ f to make sense.
(2) Answer
Solution: There are two questions in this problem.
Must f be surjective? The answer is no. Indeed, let A = {1}, B = {2, 3} and C = {4}. Then define f : A −→ B by f(1) = 2 and g : B −→ C by g(2) = 4 and g(3) = 4. We see that g ◦ f : {1} −→ {4} is surjective (since 1 7→ 4) but f is certainly not surjective. Must g be surjective? The answer is yes, here’s the proof. Suppose that c ∈ C is arbitrary (we must find b ∈ B so that g(b) = c, at which point we will be done). Since g ◦ f is surjective, for the c we have already fixed, there exists some a ∈ A such that c = (g ◦ f)(a) = g(f(a)). Let b := f(a).
Then g(b) = g(f(a)) = c and we have found our desired b. Remark: It is good to compare the answer to this problem to the answer to the two problems
on the previous page. The part of this problem most groups had the most issue with was the second. Everyone should be comfortable with carefully proving a function is surjective by the time we get to the midterm.