# $f(a+b)=f(a)+f(b)$ but $f$ is not linear

Can you show me a continuous function $f \colon \mathbb{R}^n\to\mathbb{R}^m$ that satisfies $f(a+b)=f(a)+f(b)$ but is not linear?

We have that $$f(0)=f(0+0)=2f(0)\implies f(0)=0\\ f(x-x)=f(0)=f(x)+f(-x)=0\implies f(-x)=-f(x)\\ f(nx)=f(x+x+\dots+x)=f(x)+\dots+f(x)=nf(x)\quad \forall n \in \mathbb{N}$$ But $$f(-nx)=-f(nx)=-nf(x)$$ So: $$f(ax)=af(x) \quad \forall a \in \mathbb{Z}$$

• Try it for $n=m=1$. Your argument seems to have shown that it's linear on $\Bbb Q\subset\Bbb R$. But do you know anything about $f(\sqrt2)$ or $f(\pi)$? Commented Oct 3, 2014 at 20:40
• Related and related. Commented Oct 3, 2014 at 20:43
• @mlainz: Now that it has come to your recollection, do you see how to Answer the Question yourself? Commented Oct 3, 2014 at 20:45
• @mlainz: The short answer is that rationals are dense in the reals, so continuity suffices to preserve scalar multiplication by reals as well as by rationals. Commented Oct 3, 2014 at 20:51
• For $n=m=1$ see here: math.stackexchange.com/questions/423492/… Commented Oct 4, 2014 at 17:00

Nobody can, because a continuous function $f \colon \mathbb{R}^n\to\mathbb{R}^m$ satisfying $$f(x+y)=f(x)+f(y)$$ for all $x,y\in\mathbb{R}^n$ is linear.

The proof is quite easy.

1. $f(ax)=af(x)$ for all $a\in\mathbb{Z}$ and $x\in\mathbb{R}^n$
2. $f(\frac{a}{b}x)=\frac{a}{b}f(x)$, for all $\frac{a}{b}\in\mathbb{Q}$ and all $x\in\mathbb{R}^n$

3. $f(rx)=rf(x)$, for all $r\in\mathbb{R}$ and all $x\in\mathbb{R}^n$.

For the last step, if $r\in\mathbb{R}$, consider a sequence $q_k$ in $\mathbb{Q}$ converging to $r$. Then $q_kx$ is a sequence in $\mathbb{R}^n$ converging to $rx$ and $q_kf(x)$ is a sequence in $\mathbb{R}^m$ converging to $rf(x)$. By continuity of $f$, $$f(rx)=f(\lim_{k\to\infty}q_kx)= \lim_{k\to\infty}f(q_kx)= \lim_{k\to\infty}q_kf(x)= rf(x)$$

• You could cheat and change the topology so that step 3 fails, in which case Jack's answer works. Commented Oct 3, 2014 at 23:15
• @R.. But $\mathbb{R}^n$ is a topological vector space only in one way. ;-) Commented Oct 3, 2014 at 23:18
• @egreg, hmm what about discrete topology?
– user22328
Commented Oct 7, 2014 at 21:02
• @egreg I'm sorry but I don't understand. Are you saying that it is not a TVS in the "usual sense" as in because we have an unusual topology on $\mathbb R$, or some other definition that excludes trivialities? (The definitions I'm aware of all seem to fit -- but I agree it is a very constructed example. :))
– user22328
Commented Oct 9, 2014 at 12:41
• @Pp.. from wikipedia: "A topological vector space X is a vector space over a topological field K (most often the real or complex numbers with their standard topologies) ..." (emphasis added) So it's not true that it must (according to Wikipedia on TVS).
– user22328
Commented May 19, 2015 at 22:55

The general counterexample for a function satisfying $$f(a+b)=f(a)+f(b)$$ but not being linear is to take a Hamel basis and acting with different linear maps on the elements of such a basis.

• Sorry, I forgot to mention. Would such function be continuous? Commented Oct 3, 2014 at 20:53
• Absolutely not. If you assume that $f$ is continuous and satisfies $f(a+b)=f(a)+f(b)$, then $f$ is linear as expected. Commented Oct 3, 2014 at 20:54
• @mlainz: You might find it amusing to learn that the graph of any such function that is not continuous is dense in ${\mathbb R}^m \times {\mathbb R}^{n}.$ In particular, the graph of any such function from the reals to the reals that is not continuous has a graph that is dense in the plane. This means that the graph comes arbitrarily close to every point in the plane, which is way worse than the function being discontinuous at every point. Commented Oct 3, 2014 at 21:08
• In light of the 10 upvotes for my last comment here (my personal record?), I dug up some old posts of mine having more information for those interested in this topic. This 6 October 2006 sci.math post has a proof that the graph of a nonlinear additive function from the reals to the reals is dense in the plane. (continued) Commented Oct 6, 2014 at 14:55
• (continuation) This 29 October 2001 sci.math post gives a Baire $2$ function whose graph is dense in the plane. Finally, this 5 October 2006 sci.math gives various explicit constructions of wild functions. Commented Oct 6, 2014 at 14:56
{"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 1, "mathjax_display_tex": 1, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0}