Solving the Functional Equation $ f \big( x + y f ( x ) \big) = f ( x ) f ( y ) $

Here's a different solution. $$ f(x)=\begin{cases} 1\quad\text{if}\quad x\in\mathbb{Q}\\ 0\quad\text{otherwise} \end{cases} $$ I'm quite sure there is a number of variations of this theme.

My suspicion is that without requiring continuity or differentiability, the relation will not be enough to limit the available solutions for $f(x)$ for all $x\in\mathbb{R}$, and that there might thus be an uncountable number of solutions which will be almost nowhere continuous (possibly requiring the axiom of choice to construct).


Here are a few observation on the continuous/differential case. I haven't properly proof read them, so I may have missed something.

Let's first assume that $f(0)=1$, otherwise $f(x)=0$ for all $x$.

Let's take some $x$ with $f(x)\not=0$. Because of the relation $f(x+yf(x))=f(x)f(y)$, if $f(y)$ is continuous at $y=0$, it follows that $f$ is continuous at $f(x)$.

Similarly, if $f(y)$ is differentiable at $y=0$ with $f'(0)=a$, it follows that $f$ is differentiable at $x$. Differentiation of $f(x+yf(x))=f(x)f(y)$ with $y$ at $y=0$ yields $f'(x)=f'(0)=a$. Again, this requires that $f(x)\not=0$.

So, basically, if $f(0)=0$ and $f'(0)=a$, we know that $f'(x)=a$ whenever $f(x)\not=0$, from which follows that $f(x)=ax+1$ in the segment with $ax+1\ge0$.

If $a=0$, this makes $f(x)=1$ for all $x$. For any other $a$, $f(x)=ax+1$ is a possible solution.

A solution already mentioned by others is $f(x)=\max(ax+1,0)$.

A last option, assuming $a\not=0$, is that there is a $b>1$ so that $$ f(x)=\begin{cases} ax+1\quad\text{if}\quad ax+1>0\\ ax+b\quad\text{if}\quad ax+b<0\\ 0\quad\text{otherwise} \end{cases} $$ since $f'(x)=a$ whenever $f(x)\not=0$. However, for any $y$ with $f(y)=0$, we have $f(x+yf(x))=0$ for all $x$. This means $x+yf(x)$ must be bound as $x\rightarrow\infty$ and $-\infty$, which can only happen if $y=-1/a$. So this alternative is ruled out.


Here is another solution that classifies all continuous solution. During the proof we exclude two trivial solutions $f \equiv 0$ and $f \equiv 1$ to avoid unnecessary case-division.

(Disclaimer: I heavily borrowed Tob Ernack's injectivity argument but tried a simpler proof. Although I have an independent proof, it is neither elegant nor shorter.)

Step 1. $Z: = f^{-1}(\{0\})$ is a non-empty closed interval.

$Z$ is obviously a closed set. Next, whenever $f(x) \neq 1$ we have

$$ f\left(\tfrac{x}{1 - f(x)}\right) = f\left(x + \tfrac{x}{1 - f(x)}f(x)\right) = f(x)f\left(\tfrac{x}{1 - f(x)}\right). $$

and hence $\frac{x}{1 - f(x)} \in Z$. Then the assumption $f \not\equiv 1$ shows that $Z \neq \varnothing$. Finally, if $a, b \in Z$, then

$$f(x+af(x)) = f(x)f(a) = 0 \qquad \forall x \in \Bbb{R}$$

and the function $g(x) = x+af(x)$ takes values only in $Z$. Since $g(a) = a$ and $g(b) = b$, it follows from intermediate value theorem that $[a, b] \subseteq Z$.

Step 2. $f(x) = f(y) \neq 0$ implies $x = y$.

Let $p = (y-x)/f(x)$. From

$$ f(x) = f(y) = f(x+pf(x)) = f(x)f(p),$$

we have $f(p) = 1$. Now assume that $p \neq 0$ Then

$$f(t+p) = f(p+tf(p)) = f(t)f(p) = f(t) \qquad \forall t \in \Bbb{R}$$

and hence $f$ is periodic. By Step 1, this implies that $Z$ is an interval which is unbounded in both direction, so $Z = \Bbb{R}$, contradicting the assumption $f \not\equiv 0$.

Step 3. There exists $a \in \Bbb{R}$ such that $f(x) = 1 + ax$ for $x \in \Bbb{R}\setminus Z$.

Use the assumption $f \not\equiv 0$ to choose $c \neq 0$ such that $f(c) \neq 0$ and let $a = \frac{f(c) - 1}{c}$. Then for any $x \notin Z$,

$$ f(x + cf(x)) = f(x)f(c) = f(c+xf(c)) \neq 0 $$

and so $x + cf(x) = c + xf(c)$. Solving this equation gives $f(x) = 1 + ax$.

Step 4. Except for the trivial solution $f \equiv 0$, only 2 types of solutions are possible:

  • Case 1. $f(x) = 1+ax$ for some $a \in \Bbb{R}$
  • Case 2. $f(x) = \max\{1+ax, 0\} $ for some $a \in \Bbb{R}$

Assume that $f \not\equiv 0$. Then it follows from $f(x) = f(x+0\cdot f(x)) = f(x)f(0)$ that $f(0) = 1$. This together with Step 3 shows that only Case 1 and 2 are possible solutions to the functional equation. We check that both cases are indeed solutions.

Since Case 1 is easy to verify, we focus on Case 2. Also, in Case 2, notice that $x \notin Z$ if and only if $1+ax > 0$. Then

  • If $x \in Z$, then $f(x+yf(x)) = f(x) = 0 = f(x)f(y)$.

  • If $x \notin Z$, then $x+yf(x) = x+y(1+ax) = x+y+axy$. So

    \begin{align*} x+yf(x) \notin Z &\quad \Leftrightarrow \quad 1+a(x+y+axy) = (1+ax)(1+ay) > 0 \\ &\quad \Leftrightarrow \quad 1+ay > 0. \end{align*}

    From this it is easy to check that $f(x+yf(x)) = f(x)f(y)$ holds for all $y$.

Therefore $f(x) = \max\{0,1+ax\}$ is also a solution of the functional equation.


This paper seems to show that the only continuous solutions are $$ \begin{align} f(x) &= 0 \\ f(x) &= 1+ax \\ f(x) &= \begin{cases}1+ax & x>-\frac{1}{a} \\ 0&x\leq-\frac{1}{a} \end{cases} \\ f(x) &= \begin{cases}1+ax & x<\frac{1}{a} \\ 0&x\geq\frac{1}{a} \end{cases} \end{align}$$ where $a$ is any real, and $a$ is positive for the final two cases. Unfortunately it's in French otherwise I would reproduce the argument here.