
Problem I-1. Find all functions $f: \mathbb{R} \rightarrow \mathbb{R}$ such that for all $x, y \in \mathbb{R}$, we have

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


Solution. Setting $y=0$ yields

$$
0=f(0)(f(x)-x-2)
$$

It is easy to check that $f(x)=x+2$ is not a solution, so $f(0)=0$. Setting $x=1, y=-1$, we obtain

$$
0=f(-1)(f(1)-3)
$$

so $f(-1)=0$ or $f(1)=3$.

Let us assume $f(-1)=0$. Putting $x=2, y=-1$ in the original functional equation, we get $f(-2)=f(1)$. On the other hand, setting $x=-2, y=1$ gives $f(-2) f(1)=3 f(-2)-f(1)$ which together with $f(-2)=f(1)$ gives $f(1) \in\{0,2\}$.

So we have $f(1)=a \in\{0,2,3\}$. Setting $y=1$ yields

$$
f(x+1)=(3-a) f(x)+a(x+1)
$$

for all real $x$.

Now we set $y=1+1 / x$ for arbitrary $x \neq 0$, we obtain

$$
f\left(x+\frac{1}{x}+1\right)+f(x) f\left(\frac{1}{x}+1\right)=f(x+1)+\left(\frac{1}{x}+2\right) f(x)+f\left(\frac{1}{x}+1\right)(x+1)
$$

Applying (1) yields

$$
(3-a)\left(f\left(x+\frac{1}{x}\right)+f(x) f\left(\frac{1}{x}\right)-(x+1) f\left(\frac{1}{x}\right)\right)=f(x)\left(5-2 a-(a-1) \frac{1}{x}\right)+2 a+a x
$$

From this and the original functional equation with $y=1 / x$ we have

$$
(3-a)\left(a+f(x)\left(1+\frac{1}{x}\right)\right)=f(x)\left(5-2 a-(a-1) \cdot \frac{1}{x}\right)+2 a+a x
$$

which is equivalent to

$$
f(x)\left(-2+a+\frac{2}{x}\right)=a^{2}+a x-a
$$

Using $a \in\{0,2,3\}$ we get $f(x)=0, f(x)=x^{2}+x, f(x)=3 x$ for all real $x$ (with some exceptions when $-2+a+\frac{2}{x}=0$, but this cases can be handled easily for example by using (1)). We can also easily check that the functions $f(x)=0, f(x)=x^{2}+x, f(x)=3 x$ are solutions of the original functional equation.
