Note: my equation labelling does not seem to work. Someone please help me fix it. Thanks in advance.

**The problem: IMO 2017 Q2**

Find all functions such that for all we have the following:

**Solution and Discussion**

Denote the given equation by . Cmon. It isn’t easy to see what solution would work save for . An observation is that if we simply substitute into the equation and we get for all So now we can assume . Where to go?

It’s a medium so preliminary investigations can guide us quite a long way most likely. (Even for the monstrous 2015 Q5 one should at least get to showing or before getting helplessly stuck.) So suppose , which is to say that , we shall have

for all . Now suppose that for a certain we have (you see such just has to exist, say ) we will then have and thus which is bad…. Unless .

That is to say,

As a side, for all . Ergo, . Also, gives us . Combining these two equations we have either

or vice versa.

Do they really correspond to solutions at all? At present stage it seems that the equation (*) is suggesting that , and the ‘vice versa’ demands . Substitute them in … they work! We want to only pursue one line of reasoning though.

Observation: if is a solution, is also a solution. This is because . So we can really WLOG assume (*) is true. (why not the vice versa? Because is an involution, that is, which could simplify our work a lot potentially.)

First of all,

And here you go,

which is to say that So it remains to show is surjective!

Sounds nice, doesn’t work. Sad!

If surjection doesn’t work, one might still try injection. So let’s try to show injection. Doesn’t seem easy… Suppose , and gives us that, provided that , . So let’s pause for a moment, and see if can be shown…

As a matter of fact, your OP got exceedingly lucky when trying this problem. He somehow made a bad mistake that gave him true conclusions. Don’t ask him how. The OP just somehow figured out that

To show (4), we look back into the original equation .

Combining the above two pieces of computation we get

by referencing (2) and (3).

Whooosh. That was precarious. But now we have (4), which gives us not only that , but also that, if , , and if we both sides, . Suppose we could show that , we would be able to ‘undress’ the RHS and get and thus getting . Sounds like a plan. Well, (3) says if , and (2) says if , . Now so it works.

Hooray! We have just shown that if with , we must have and thus . Reference (2), we have that . Recall that is the *only* root to , we have . Thus . YAY!!! is indeed injective!!!

The rest is easy. (3) shows that and by injectivity and by (3) we have for all .

The solutions are and

**Comment**

What a tedious problem…. Took me two hours + to solve. It’s easy to leave gaps in the solution here and there, for instance the OP believed he got the identity that but in fact it demands to hold. It helped him discovering (4) though. (4) is really important (and somewhat natural to think of after we have discovered (3)).

The entire solution shows the power of setting instead of because (3) will take some much more deplorable forms had we chosen to work with, so will be (4) — in my humble opinion. I am happy to be shown wrong and be presented a proof using as starting point — I have not yet tried, but it looks disastrous to me.

OP was surprised to see that the key to the solution is injectivity really. The equation looks nothing like something for which injectivity would be a step towards solution — no naked variable anywhere. The point that is the only root to must be made for it is the essential cornerstone of any effort towards injectivity.

One might be tempted to use analysis, but I personally do not believe that analysis will be helpful. Analysis required inequality whereas this problem only gives equality that is difficult to be transformed into inequalities.