[Math] The sum of two onto functions is not necessarily onto

functionsreal numbers

The questions and solution is as follows:

If $f : \mathbb{R} → \mathbb{R}$ and $g : \mathbb{R} → \mathbb{R}$ are functions, then the function $(f + g) : \mathbb{R} \to \mathbb{R}$ is defined by the formula $(f + g)(x) = f(x) + g(x)$ for all real
numbers $x$. If $f : \mathbb{R} \to \mathbb{R}$ and $g : \mathbb{R} \to \mathbb{R}$ are both onto, is $f + g$ also
onto? Justify your answer.

Solution:

This is not necessarily true. Consider $f(x) = x$ and $g(x) = −x$.
Clearly these two functions are onto but $(f + g)(x) = f(x) + g(x) =
0$ which only has image $0$, and so is not onto.

The domain and codomain of all functions in this question — $f$, $g$, and $f+g$ — are specified in the question to be the set of real numbers. If $f(x) = x$ and $g(x) = −x$ then the range of the function $f+g$ is $\{0\}$. Therefore the function $f+g$ is not onto since there are elements of the codomain that are not mapped to.

Can you further simplify the solution? I don't understand what is mapping to $x$ and $-x$ in $f(x)$ and $g(x)$, and why isn't anything mapping to $0$ when $0$ was mapped to in $f(x) = x$ and when $g(x) = -x$. Could you explain this like I'm five? (not literally)

Best Answer

(This is really an answer to your comment, but I think it may be what you need for your question.)

I think the issue is that you may not be clear on the difference between range and codomain of a function. The codomain is simply "the set written second" in the function: if you have $$f:A\to B$$ then the codomain is $B$. That's it - nothing to work out, nothing to calculate, just look at it. The range, on the other hand, is the set of all $f(x)$ values which are actually achieved.

In your example, both $f$ and $g$ have codomain $\Bbb R$. (Why? - simply because you said so! You could have specified different codomains, but then you would have, strictly speaking, different functions, and ones that were not relevant to the question.) Therefore $f+g$ also has codomain $\Bbb R$, because this is part of the definition of the sum of two functions. However, as you have observed, $f+g$ only takes the value $0$, and so its range is $\{0\}$. The fact that the range is different from the codomain shows that $f+g$ is not onto.

Hope this helps!!

Related Question