TITLE: A functional equation $\varphi(x) = \epsilon(x)\epsilon(x+x_1)\varphi(x+x_2)$
QUESTION [7 upvotes]: First, let $\epsilon:\mathbb{R}\rightarrow \mathbb{R}$ defined by $1$ over $[-1,1)$ and extended over $\mathbb{R}$ by $2$-antiperiodicity (for example, $\forall x\in [-2,-1)$, $\varepsilon(x)=-1$).
I would like to find all $2$-antiperiodic $\varphi:\mathbb{R}\rightarrow \mathbb{R}$, $x_1,x_2\in\mathbb{R}$, such that
\begin{equation}\forall x\in \mathbb{R},\quad  \varphi(x) = \epsilon(x)\epsilon(x+x_1)\varphi(x+x_2)
\end{equation}
It is assumed that $\varphi$ is piecewise-continuous, with a finite number of discontinuities over $[-1,1]$.
I managed to find some solutions as follows, but I am looking for a more general approach. By squaring the equality, it comes that $\varphi(x)^2 = \varphi(x+x_2)^2$ so $\varphi^2$ is both $2$-periodic and $x_2$-periodic. If $x_2\not\in\mathbb{Q}$, necessarily $\varphi^2$ is constant because its set of discontinuous points is not dense in $\mathbb{R}$. An example of such solution is $\varphi(x)=\epsilon(x)\epsilon(x+x_1)$, provided $x_1<2$ and $x_1+x_2$ is a multiple of $4$. Then, $\varphi(x+x_2)=\varphi(x-x_1)$, which is equal to $1$ ($\star$), hence $\varphi(x)=\varphi(x)\varphi(x+x_2)$ for $x\in[-1,1]$, and so $\varphi(x) = \epsilon(x)\epsilon(x+x_1)\varphi(x+x_2)$.
($\star$) Either $x\in[-1+x_1,1]$ and it comes directly from the definition of $\epsilon$, either $x\in[-1,-1+x_1)$ and it comes from 2-antiperiodicity of $\varphi$ and $\varepsilon$)

REPLY [2 votes]: I am thinking about your question for some time and have the following partial results. 
We’ll be consider $x_1$ and $x_2$ as given constants. 
We can split the problem putting $\varphi(x)=\delta(x)|\varphi(x)|$, where is $\delta(x)$ is the sign of $\varphi(x)$. Then the initial equation is equivalent to a system
(1) $|\varphi(x)|=|\varphi(x+x_2)|$
(2) $ \delta(x) = \varepsilon(x)\varepsilon(x+x_1)\delta(x+x_2)$. 
Assume that $x_2$ is irrational. As you have mentioned, in this case $|\varphi|=c$ is constant, so it remains to solve Equation (2). If $c=0$ then $\delta(x)=0$ for all $x$, so farther we’ll assume that $c\ne 0$. Then $\delta(x)\ne 0$ for all $x$. 
For a function $f:\Bbb R\to\Bbb R$ by $D(f)$ we denote the set of all points $x$ where $f$ is discontinuous. By the condition, $D(\varphi)$ is finite on each interval. Since $\delta(x)\ne 0$ for all $x$, $D(\delta)\subset D(\varphi)$, so the set $D(\delta)$ is finite on each interval too. Since $\delta(x)=\pm 1$ for each $x$, the problem to solve Equation (2) reduces to calculating the set $D(\delta)$.  
Let $x\in D(\delta)$. Equation (2) implies that 
(3) either $x\in D(\varepsilon)$ or $x+x_1\in D(\varepsilon)$ or $x+x_2\in D(\delta)$ 
Iterating (3), we see that either $x+x_2\in D(\delta)$  for all natural $n$, or there exists a non-negative integer $n_+(x)$ such that $x+n_+(x)x_2\in D(\varepsilon)\cup (D(\varepsilon)-x_1)$. Since $x_2$ is irrational and $\delta$ is $4$-periodic, the first case is impossible. Similarly we can show that there exists a positive integer $n_-(x)$ such that $x-n_-(x)x_2\in D(\varepsilon)\cup (D(\varepsilon)-x_1)$. Then 
$$(n_+(x)+ n_-(x))x_2\in (D(\varepsilon)\cup (D(\varepsilon)-x_1))- (D(\varepsilon)\cup (D(\varepsilon)-x_1)).$$
Recall that $D(\varepsilon)=1+2\Bbb Z$. Since $x_2$ is irrational, we have that  $x_1\not\in 2\Bbb Z$ and the only possible cases are $x+n_+(x)x_2\in D(\varepsilon)$ and $x-n_-(x)x_2\in D(\varepsilon)-x_1$ or $x-n_-(x)x_2\in D(\varepsilon)$ and $x+n_+(x)x_2\in D(\varepsilon)-x_1$.  Then 
$(n_+(x)+ n_-(x))x_2\in \pm  x_1+2\Bbb Z$, so $x_1=2k_1+k_2x_2$ for some integer numbers $k_1$ and $k_2\ne 0$. So we can specify Equation (2) as 
(4) $ \delta(x) = \varepsilon(x)\varepsilon(x+2k_1+k_2x_2)\delta(x+x_2)$.
Depending on the parity of $k_1$ it splits into 
($4_+$) $ \delta(x) = \varepsilon(x)\varepsilon(x+k_2x_2)\delta(x+x_2)$
($4_-$) $ \delta(x) =- \varepsilon(x)\varepsilon(x+k_2x_2)\delta(x+x_2)$.
I have to go to a picnic with my boss soon, so now I have no time to think farther. Maybe later I’ll manage to make some progress, but feel free to continue from here. Also Idéophage may feel free to use the above results for own answer (anyway, I am not clung to bounties. :-) )