The answer is yes. 

Indeed, in view of the possible replacement $f(x)$ by $\min(N,\max(-N,f(x))$ for an arbitrary real $N>0$ and all real $x$, assume without loss of generality that the function $f$ is bounded. 

Let then 
$$F(x):=\int_0^x f(t)\,dt$$
for real $x\ge0$ and $F(x):=-F(-x)$ for real $x<0$. Then for all $d\in D$ and real $x\ge0$
$$F(x)=\int_0^x f(t+d)\,dt=F(x+d)-F(d),$$
so that 
$$F(x+d)=F(x)+F(d). \tag{1}\label{1}$$
Similarly, \eqref{1} holds for all real $x<0$ and all $d\in D$. Therefore and because $F$ is continuous, \eqref{1} holds for real $x$ and all real $d$. So, $F(x)=cx$ for some real $c$ and all real $x$. So, $f$, being an a.e. derivative of the absolutely continuous function $F$, equals $c$ a.e. $\quad\Box$