The whole solution for this functional equation question from the International Mathematical Olympiad (IMO 2017 problem 2) may be written out in a page or two. However, it is my desire not to write a solution for a competition purpose but rather for the purpose of helping a student understand the details too!
The solution presented here is not purely mine as I needed help with proving the ‘f is injective part’. May the discussion here be beneficial to those wanting to understand the details & depth of this functional equation problem.
The Question & full Solution with explanations may be found in the 24 images below: