# The sum of two onto functions is not necessarily onto

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)

• I am fairly sure this "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" does not make sense, within the English language. – Silvia Ghinassi Nov 11 '15 at 1:26
• Sorry, I think I'm confusing myself. I guess I'm trying to ask, if every real number maps to zero in f+g then why doesn't it map to {0}? – Helpsun Nov 11 '15 at 1:32
• When we write something like $f: A\to B$ that means that the function $f$ takes elements from the set $A$ assigns to them elements in the set $B$. The notation does not guarantee that every element in $B$ is assigned. You are correct, that in your particular case we could have written $f+g: \mathbb R \to \{0\}$ but it is not incorrect to write $f+g: \mathbb R \to \mathbb R$ – lulu Nov 11 '15 at 1:37

(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!!

• I think I'm getting this a lot more than before. I initally believed that 0 is whats left of f+g and it has a domain that can be mapped on it. If I may reiterate what you said, and put in my thoughts. I think I finally get it. So f+g is essentially x + -x which equals 0, the new range of what it can be mapped to. But there is still an infinite amount of real numbers and f+g can only map to one of them, 0, whereas before it mapped to anything on the graph, x and -x. Thanks for your help! – Helpsun Nov 11 '15 at 3:35

I don't understand what is mapping to $x$ and $-x$ in $f(x)$ and $g(x)$

For $f$ you can put in any $x \in \mathbb{R}$ and get $x$ back.
For $g$ you can put in any $x \in \mathbb{R}$ and get $-x$ back.

and why isn't anything mapping to $0$ when $0$ was mapped to in $f(x) = x$ and when $g(x) = -x$.

This is not the case, all considered maps map $0$ to $0$: $f(0) = 0$, $g(0) = -0 = 0$, $(f+g)(0) = f(0) + g(0) = 0 + 0 = 0$.