Problem

Source: 2011 Indonesia TST stage 2 test 3 p1

Tags: algebra, functional equation, functional equation in Q, functional



Let $Q^+$ denote the set of positive rationals. Determine all functions $f : Q^+ \to Q^+$ that satisfy both of these conditions: (i) $f(x)$ is an integer if and only if $x$ is an integer; (ii) $f(f(xf(y)) + x) = yf(x) + x$ for all $x, y \in Q^+$.