Let $\mathbb{Q}$ be the set of rational numbers. Determine all functions $f : \mathbb{Q}\to\mathbb{Q}$ satisfying both of the following conditions. $f(a)$ is not an integer for some rational number $a$. For any rational numbers $x$ and $y$, both $f(x + y) - f(x) - f(y)$ and $f(xy) - f(x)f(y)$ are integers.
Problem
Source: 2022 Thailand Online MO P10
Tags: function, Functional Equations, algebra, number theory, functional equation
04.04.2022 20:59
2022 TOMO/10 wrote: Let $\mathbb{Q}$ be the set of rational numbers. Determine all functions $f : \mathbb{Q}\to\mathbb{Q}$ satisfying both of the following conditions. $f(a)$ is not an integer for some rational number $a$. For any rational numbers $x$ and $y$, both $f(x + y) - f(x) - f(y)$ and $f(xy) - f(x)f(y)$ are integers. The answer is $\boxed{f(x) = x}$ for any $x \in \mathbb{Q}$, which clearly works. We'll now prove that there are no other functions which satisfy the above two conditions. First of all, some abuse of notations: we write $x \equiv y$ to indicate $x - y \in \mathbb{Z}$. From the first condition, there exists $a \in \mathbb{Q}$ such that $f(a) \in \mathbb{Q} \setminus \mathbb{Z}$. Therefore we can write $f(a) = \frac{a_1}{n}$ for some $a_1, n \in \mathbb{Z}$, $n \ge 2$ and $\gcd(a_1,n) = 1$. Claim 01. $f(a^\ell) = \frac{a_{\ell}}{n^{\ell}}$ for some $a_{\ell} \in \mathbb{Z}$ such that $\gcd(a_{\ell}, n) = 1$ for any $\ell \in \mathbb{N}$. Proof. We will prove this by induction. The claim is indeed true for $\ell =1$. Now, suppose that this is true for $\ell = i$. We then have $f(a^i) = \frac{a_i}{n^i}$ for some $a_i \in \mathbb{Z}$ such that $\gcd(a_i, n) = 1$. Now, we have \[ f(a^{i + 1}) \equiv f(a^i)f(a) = \frac{a_i}{n^i} \cdot \frac{a_1}{n} = \frac{a_i a_1}{n^{i + 1}} \]However, it is clear that as $\gcd(a_i, n) = 1$ and $\gcd(a_1, n) = 1$, then $\gcd(a_i a_1 , n) = 1$ as well, which implies that the claim is true for $\ell = i + 1$ as well. Claim 02. $f(x+y) = f(x) + f(y)$ for any rational number $x$ and $y$. Proof. Let us denote the condition $f(x+y) \equiv f(x) + f(y)$ as (1) and $f(xy) \equiv f(x)f(y)$ as (2). \begin{align*} f(a^{\ell})(f(x) + f(y)) &\stackrel{(2)}{\equiv} f(a^{\ell}x) +f(a^{\ell}y) \\ &\stackrel{(1)}{\equiv} f(a^{\ell}(x + y)) \\ &\stackrel{(2)}{\equiv} f(a^{\ell})f(x+y) \end{align*}This implies $f(a^{\ell})(f(x+y) - f(x) - f(y)) \equiv 0$, i.e. $f(a^{\ell})(f(x+y) - f(x) - f(y)) \in \mathbb{Z}$ for any positive integer $\ell$. From our first claim, if $f(x+y) - f(x) - f(y) = \frac{p}{q}$ for some $p,q \in \mathbb{Z}$ and $\gcd(p,q) = 1, q > 0$, then this implies $n^{\ell} \mid p$ for any positive integer $\ell$. This forces $p = 0$, i.e. $f(x+y) = f(x) + f(y)$. Claim. $f(x) = x$ for all $x \in \mathbb{Q}$ Proof. Since $f: \mathbb{Q} \to \mathbb{Q}$ is additive, then we conclude that $f(x) = cx$ for some $c \in \mathbb{Q}$. Now, note that \[ 0 \equiv f(x)f(y) - f(xy) = cxy(c - 1) \]for any $x,y \in \mathbb{Q}$. Let us suppose that $c \notin \{ 0, 1 \}$, i.e. $c(c-1) \not= 0$, then we can take $xy = (1, z)$ where $0 < z < \frac{1}{|c(c - 1)|}$. This implies \begin{align*} |f(x)f(y) - f(xy)| &= |cxy(c - 1)| &= |c(c - 1)| \cdot z < 1 \end{align*}which implies $f(x)f(y) - f(xy) \not \equiv 0$, a contradiction. Therefore $c \in \{ 0, 1 \}$. However, if $c = 0$, then $f(x) = 0$ for all $x \in \mathbb{Q}$, contradicting the first condition.