$g(f(x)+c)=g(f(x))+d$ Let $f,g$ be real functions. $c,d$ are constants. $x$ is a variable.
Condition: for any $c$ there exists a $d$ such that $g(f(x)+c)=g(f(x))+d$.
What is $g$ if and only if the condition hold?
For example $g$ can be an affine function.
Let $c$ be considered as a constant function. I think if we define $G[f+c](x)=g(f(x)+c)$, then $G$ is something like a linear functional, as $g(f(x)+c)=g(f(x))+g(c)$. However I am not sure if this is a necessary and sufficient condition. 
 A: If it is assumed that $f(x)$ is given and piecewise continuous, then we know it's image $I\subseteq\mathbb{R}$. We can also partition it's image in intervals $\{I_n|I=\cup_nI_n\}$ in which $f(x)$ is piecewise continuous and invertible. Then in each of those intervals we obtain 
$$g(x+c)=g(x)+d(c)~~\forall c$$
per the condition of the question. If $d$ is assumed to be differentiable in the neighbourhood of the origin, the only solution possible to this equation is by taking a limit of both sides:
$$\lim_{c\to 0}\frac{g(x+c)-g(x)}{c}=\lim_{c\to 0}\frac{d(c)-d(0)}{c}$$
and thus we have $g'(x)=d'(0)\Rightarrow g(x)=d'(0)x+k(c)$, as the most general solution in any of the intervals. Plugging in to the original equation we obtain that actually $k(c)$ remains undetermined, but then we get the necessary condition that for $g$ to be non-zero in the interval, we need to set 
$$d(c)=d'(0)c$$
and thus if non-trivial functions are to exist that satisfy this equation, $d$ can only be at most linear. Unfortunately, from the above construction one cannot really construct any more interesting solutions, by appending lines together on the image intervals on which $f$ is invertible, since we already assumed that $g$ is differentiable everywhere, which requires $g(x)=Ax+B, d(c)=Ac$ over it's whole range.
