# Functional equations $f(x+y)= f(x) + f(y)$ and $f(xy)= f(x)f(y)$

Let $f:\mathbb{R}\to \mathbb{R}$ is a function such that for all real $x$ and $y$, $f(x+y)= f(x) + f(y)$ and $f(xy)= f(x)f(y)$, then prove that $f$ must be one of the two following functions:

• $f:\mathbb{R}\to \mathbb{R}$ defined by $f(x)=0$ for all real $x$

OR

• $f:\mathbb{R}\to\mathbb{R}$ defined by $f(x)=x$ for all real $x$

I got to the point where putting the two equations together, you get $f(x+y)f(x)= f(xy) + f(x)^2$ and plugging in $f(x)=x$ checks with it. So am I going in the right direction or am I just doing some guess work? Is there a more elegant way of doing it?

Thanks

• No, that's not right because the logic is wrong. You have proved that $f(x)$ might be $x$, but you have not proved that "$f$ must be one of the two following functions". Commented Feb 20, 2014 at 22:19
• Commented Aug 31, 2015 at 14:55

I am providing another answer without the use of the Axiom of Choice this time:

As already observed $$f(x)=0$$ is a solution of this functional equation.

Assuming that $$f$$ is not the identically zero solution we obtain that $$f(1)=1$$ since for every $$x$$: $$f(x)=f(x\cdot 1)=f(x)f(1).$$ Next, obtain that $$f(n)=\underbrace{f(1)+\cdots+f(1)}_{n\,\,\text{times}}=n,$$ for every $$n\in\mathbb N$$. Also $$f(0)=f(0+0)=f(0)+f(0)$$, and thus $$f(0)=0$$, and $$0=f(n-n)=f(n)+f(-n),$$ and thus $$f(-n)=-f(n)$$, and hence $$f(k)=k$$, for all $$k\in\mathbb Z$$. Finally $$f(1)=\underbrace{f(1/q)+\cdots+f(1/q)}_{q\,\,\text{times}},$$ and thus $$f(1/q)=1/q$$ similarly $$f(p/q)=p/q$$ and $$f(r)=r\quad \text{for every}\quad r\in\mathbb Q.\tag{1}$$

Next, observe that, if $$x\ge 0$$, then $$f(x)=f\big(\sqrt{x}\big)\,f\big(\sqrt{x}\big),$$ and hence $$x\ge 0\quad\Longrightarrow f(x)\ge 0.$$ In particular, $$\text{If}\,\,\,\,\, y \ge x\,\,\,\,\, \text{then}\,\,\,\,\, f(y)=f(x)+f(y-x)\ge f(x). \tag{2}$$

Finally, we shall show that $$f(x)=x$$ for all $$x\in\mathbb R$$. Suppose that for some $$x\in\mathbb R$$: $$f(x) Then there is a rational $$r$$, such that $$f(x) But $$(1)$$ and $$(2)$$ imply that $$r=f(r) which contradicts $$(3)$$. The case $$f(x)>x$$ is dealt with similarly.

• Contradiction is because f(x) = r too from 1 and 2 , but 3 us a strict inequality thats why only right ? No other reason right ? And we dont show for irrationals if its being true or not ? Commented Jun 3, 2022 at 17:15
• @Orion_Pax See the current version. I fixed a minor slip up in the order of (3) first without fixing the contradiction; now that edit is finally through, I'm very sorry. Commented Dec 20, 2023 at 4:59

If $f(x+y)=f(x)+f(y)$, then $f(px+qy)=pf(x)+qf(y)$, for all $p,q\in\mathbb Q$, and thus $f$ is a linear functional on the vector space $\mathbb R$ over $\mathbb Q$.

Therefore, $f$ is fully determined once its values are known on a Hamel basis of $\mathbb R$ over $\mathbb Q$. A Hamel basis in this case is a set $B\subset\mathbb R$, such that every $x\in\mathbb R$ can be written uniquely as a linear combination of elements of this $B$ with rational coefficients. (Such basis exists as a consequence of Zorn's Lemma.)

But for every $x\ge 0$ $$f(x)=f\big(\sqrt{x}\big)\,f\big(\sqrt{x}\big),$$ which means that $$f(x)\ge 0\quad\text{whenever} \quad x\ge 0.\tag{1}$$ In the case $f$ is not a continuous linear functional on $\mathbb R$ over $\mathbb Q$, there exist $a,b\in\mathbb R$, linearly independent over $\mathbb Q$, such that the values $$f(a),\, f(b),$$ are not proportional to the values $$a,\,b.$$ In no such pair existed, then $f$ would be $f(x)=cx$. Using these values we can create a linear combination of them $$pa+qb>0,$$ such that $$f(pa+qb)<0,$$ which contradicts $(1)$.

Thus $f$ is continuous, which implies that $f(x)=cx$, for some $c\ge 0$, and since $$cxy=f(xy)=f(x)f(y)=c^2xy,$$ then the only acceptable values of $c$ are $0$ and $1$. Thus $$f(x)=x \quad\text{or}\quad f(x)=0.$$

Easier way from the first identity: $$f(x) = f(x+0) = f(x) + f(0)$$ so $f(0) = 0$ and similarly $$f(x) = f(x \cdot 1) = f(x) f(1)$$ so $f(x) = 0$ or $f(1) = 1$.

In the first choice, you are done. Suffices to prove that if $f(1)=1$ then $f(x) = x$. Can you take it from here?

EDIT Another hint: Note that if $f(1)=1$, $$f(n) = f(1 + 1 \ldots + 1) = n f(1) = n$$ for all integer $n$...

EDIT 2 Another hint... to do rational numbers, $$f(1) = f(1/n) + f(1/n) + \ldots + f(1/n) = n f(1/n),$$ so $f(1/n) = f(1)/n = 1/n$ and similarly $f(a/b) = a/b$.

You can use a similar technique to show $f(\sqrt[b]{a}) = \sqrt[b]{f(a)}$.

There must be a more direct way to prove $f(ax) = af(x)$ for all real $a$...

• Would you please elaborate how you concluded that f(x)=0? And no I can't seem to figure out how to proceed with the second part. Commented Feb 20, 2014 at 22:28
• @user130113 included another hint for you. As for $f(0)$, note we proved $f(x) = f(x) + f(0)$ so subtract $f(x)$ from both sides. Commented Feb 20, 2014 at 22:29
• Yes, I understood how f(0)= 0 is true, but how did you conclude f(x)= 0? Commented Feb 20, 2014 at 22:33
• @user130113 So you have $f(x) = f(x) \cdot f(1)$. Thus, either $f(1) =1$ or $f(x) = 0$ - it's the only other possible solution to the equation... Commented Feb 20, 2014 at 22:34
• Oh I see, that explains. As for the 2nd hint, are you suggesting I should prove it separately for integers, rationals and irrationals? A hint was given alongwith the question that at some point the fact that every x>0 can be expressed as x=t^2 will be essential. Commented Feb 20, 2014 at 22:45

These functional equations are rather famous and you can read more here. Actually:

$$f(x+y) = f(x) + f(y)$$

is called Cauchy functional equation and its solutions are $f(x) = cx$; $\forall c \in R$

Now substitute into the second functional equations and we have:

$$f(xy) = f(x)f(y) \implies cxy = c^2xy$$

So we have two cases: $c = 0$ or $c=1$. So we have $f(x) = 0$ and $f(x) = x$ as solutions.

Hence the proof.

• Only if you assume continuity $f(x+y)=f(x)+f(y)$, implies that $f(x)=cx$. Commented Feb 20, 2014 at 22:20