If $B(x+y)-B(x)-B(y)\in\mathbb Z$ can we add an integer function to $B$ to make it additive?

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.