If $B(x+y)-B(x)-B(y)\in\mathbb Z$ can we add an integer function to $B$ to make it additive?
Given a function $B:\mathbb R\to\mathbb R$ satisfying $B(x+y)-B(x)-B(y)\in\mathbb Z$ for all real numbers $x$ and $y$, is there a function $Z:\mathbb R\to\mathbb Z$ such that $B+Z$ is an additive function? In other words, is there a function $A:\mathbb R\to\mathbb R$ satisfying $A(x+y)=A(x)+A(y)$ for all real numbers $x$ and $y$, such that $A(x)-B(x)\in\mathbb Z$ for every real number $x$?
My motivation: I was thinking about real solutions of the d'Alembert functional equation, $f(x+y)+f(x-y)=2f(x)f(y)$, without assuming continuity. There was a case where I could show that for some real function $B$, $f(x)=\cos\big(2\pi B(x)\big)$ and $\cos\Big(2\pi\big(B(x+y)-B(x)-B(y)\big)\Big)=1$ so for every $x$ and $y$ we have $B(x+y)-B(x)-B(y)\in\mathbb Z$. I was wondering if there's an additive function $A$ such that $A(x)-B(x)\in\mathbb Z$ for every $x$. In that case, I could show that the solution is of the form $f(x)=\cos(2\pi A(x))$ where $A$ is additive. It's easy to verify that every function of this form is indeed a solution to the functional equation. (In other cases I could show that $f$ is the constant zero function or is of the form $f(x)=\cosh\big(A(x)\big)$ for some additive function $A$. But they're not related to my question here.)
My attempt: I defined $n(x,y)=B(x+y)-B(x)-B(y)$. So $n(x,y)=n(y,x)$ and $n(x,0)=-B(0)$. Without loss of generality, we can assume that $B(0)=0$ (otherwise we can subtract $B(0)$ from $B(x)$ and continue). Because $x+(y+z)=(x+y)+z$, therefore I could conclude that $n(x,y+z)+n(y,z)=n(x+y,z)+n(x,y)$. But this doesn't seem to help much.
Solution 1:
There is a similar problem here: USA January TST 2015
Firstly, we show that there is a function $B:\mathbb Q\to\mathbb R$ such that for every rational $x$ and $y$, $B(x+y)-B(x)-B(y)\in\mathbb Z$, but there's no additive function $A$ such that $B(x)-A(x)\in\mathbb Z$ for every rational $x$.
It's well known that if $A$ is an additive function then there is a constant $c$ such that $A(x)=cx$ for every rational $x$. See here for a proof.
Now construct $B\left(\frac pq\right)=\frac pqK(q)$ where $\gcd(p,q)=1$, $q>0$ and $K(q)=\sum\limits_{i=0}^{q-1} i!$.
I claim that we have $B(x+y)-B(x)-B(y) \in \mathbb{Z}$, for every rational $x$ and $y$.
Let $x=\frac{a}{b}$, $y=\frac{c}{d}$ and $\frac{p}{q}=\frac{a}{b}+\frac{c}{d}$ where $\gcd(a,b)=\gcd(c,d)=\gcd(p,q)=1$. Then, in mod $1$, we have:
$$B\left(\frac pq\right)-B\left(\frac ab\right)-B\left(\frac cd\right)=\frac pqK(q)-\frac abK(b)-\frac cdK(d)\equiv\left(\frac pq-\frac ab-\frac cd\right)K(bd)=0$$
Notice that for $m\ge n$, we have $m!\equiv0\pmod n$, so $K(q+m)\equiv K(q)\pmod q$ for all $m\ge0$.
Now I claim that there is no $c$ such that $B(x)-cx\in\mathbb{Z}$ for all $x\in\mathbb{Q}$.
Suppose that there is such $c$. If $q$ is a positive integer, then $B(\frac 1q)-\frac cq=\frac1q(K(q)-c)\in\mathbb Z$. So $c$ is an integer such that for every postive integer $q$, we have $K(q)\equiv c\pmod q$. for instance, we have $K(q!)\equiv c\pmod{q!}$. But by definition of $K$, we know that $K(q!)\equiv K(q)\pmod{q!}$ which leads to $K(q)\equiv c\pmod{q!}$. Hence there is a sequence of integers like $(k_q)_{q\in\mathbb Z^+}$ such that $c=k_q\cdot q!+K(q)$. Now for every positive integer $q$:
$$0=c-c=k_{q+1}\cdot (q+1)!+K(q+1)-k_q\cdot q!-K(q)=\left((q+1)k_{q+1}-k_q+1\right)q!$$ $$\therefore\quad k_{q+1}=\dfrac{k_q-1}{q+1}$$
Now we show that for every natural number $n$, we must have $|k_q|\ge q^n$. For the base case, we note that if $k_q=0$, then $k_{q+1}$ can't be an integer, so $|k_q|\ge1=q^0$. For the induction step, we have:
$$\dfrac{|k_q|+1}{q+1}\ge\dfrac{|k_q-1|}{q+1}=|k_{q+1}|\ge (q+1)^n$$ $$\therefore\quad|k_q|\ge(q+1)^{n+1}-1\ge q^{n+1}$$
But this leads to an obvious contradiction. So $c$ doesn't exist.
Finally, we show that there is a function $B:\mathbb R\to\mathbb R$ such that for every real $x$ and $y$, $B(x+y)-B(x)-B(y)\in\mathbb Z$, but there's no additive function $A$ such that $B(x)-A(x)\in\mathbb Z$ for every real $x$. So the answer to the original question is negative.
Let $({\bf e}_i)_{i\in I}$ be a Hamel Basis. So for every real number $x$, there is a finite set of indices $I_x\subseteq I$ and rational numbers $\left(\frac{p_i}{q_i}\right)_{i\in I_x}$ such that $\gcd(p_i,q_i)=1$, $q_i>0$ and $x=\sum\limits_{i\in I_x}\dfrac{p_i}{q_i}{\bf e}_i$. Define:
$$B(x)=\sum_{i\in I_x}\frac{p_i}{q_i}K(q_i)$$
Note that $I_x$ and $\left(\frac{p_i}{q_i}\right)_{i\in I_x}$ are uniquely determined and thus $B$ is well defined. We can check that $B$ satisfies the desired conditions, similar to what we did before.