# 2017 IMO Problems/Problem 2

Let $\mathbb{R}$ be the set of real numbers , determine all functions $f:\mathbb{R}\rightarrow\mathbb{R}$ such that for any real numbers $x$ and $y$ ${f(f(x)f(y)) + f(x+y)}$ =$f(xy)$

## Solution

Let $y=x$, so the equation becomes $f(f(x)^{2})+f(2x)=f(x^{2})$. Notice that if $x=0$, $2x=x^2$, so $f(f(0)^{2})=0$, meaning that there exists at least 1 real solution to $f(x)=0$.

Let $f(0)=n$, so $f(n^{2})=0$.

Let $y=n^2$, so $f(x+n^2)=f(xn^2)-n$.

If $x+n^2=xn^2$, or $x=\frac{n^2}{n^2-1}$, then $f(x+n^2)=f(xn^2)$, so $n=0$. The only way n can not equal 0 is if there is no solution to $x+n^2=xn^2$, so $n^2=1$ if $n$ does not equal 0.

This means that the only possible values of $n$ is -1,0, and 1.

Go through the cases:

$n=-1$

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

$f(1)=0$ (Based on $f(n^2)=0$)

$f(2)=1$

$f(3)=2$

...

$f(x)=x-1$

$n=0$

$f(x)=0$

$n=1$

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

$f(1)=0$ (Based on $f(n^2)=0$)

$f(2)=-1$

$f(3)=-2$

...

$f(x)=1-x$

So the only solutions are $f(x)=x-1$, $f(x)=0$, and $f(x)=1-x$.