TITLE: Rademacher's integral with $sgn$ function
QUESTION [5 upvotes]: Let $(r_n)_{n=1}^\infty$ be the sequence of Rademacher functions.
Prove that for all positive integers $n_1<n_2<\cdots<n_k$ and
$p_1,\dots,p_k$, it holds that
\begin{equation*}
     \int_{0}^1r_{n_1}^{p_1}(t)\cdots r_{n_k}^{p_k}(t)dt=\left\{\begin{aligned}
     &1, \text{ if each }p_j\text{ is even},\\
     &0, \text{ otherwise.}
    \end{aligned}\right. 
\end{equation*}

My attempt was to look at each $n$th Rademacher's function:
$$r_n(t)=sgn(\sin(2^n\pi t)),$$
for all $t\in[0,1]$ and
\begin{equation*}
    sgn:\mathbb{R}\to\mathbb{R},\text{ }\text{ }sgn(x)=\left\{\begin{aligned}
        1&, &\text{ if }x>0,\\
        0&, &\text{ if } x=0,\\
        -1&, &\text{ if } x<0.
    \end{aligned}\right.
\end{equation*}
So
$$\int_0^1\displaystyle\prod_{j=1}^k[sgn(\sin(2^{n_j}\pi t))]^{p_j}dt$$
will be zero if at least for a $j_0$, we have:
$$\sin(2^{n_{j_0}}\pi t)=0.$$
It happens when $2^{n_{j_0}}\pi t=\pi l$, for all $l\in\mathbb{Z}$. Then $2^{n_{j_0}} t=l$. Hence $2^{n_{j_0}}t$ is a integer number.
I can't get anything done for the $p_j$. Is there any other approach to this exercise?

REPLY [2 votes]: Let $r_n(t) = \text{sgn}(\sin(t))$ on $\Omega = [0,1] \setminus \{{m}/{2^n} : n = 1,2,\dots, 0 \le m \le 2^n\}$, that is, remove a set of measure zero where we might be taking the sign of $0$.  Let
$$ \phi_n(t) = \cases{t + 1/2^n &if $t\in(\tfrac m{2^n},\tfrac{m+1}{2^n})$ for $m$ even\cr t-1/2^n &if $t\in(\tfrac m{2^n},\tfrac{m+1}{2^n})$ for $m$ odd.}$$
Then $\phi_n:\Omega\to\Omega$ is a measure preserving map such that $r_n\circ\phi_n = -r_n$ and $r_m \circ \phi_n = r_m$ is $m \ne n$.  Thus if $s(t) = r_{n_1}(t)^{p_1} \cdots r_{n_k}^{p_k}(t)$, and if $p_j$ is odd for some $j$, then $s\circ\phi_{p_j} = -s$.  So
$$\int s(t) \, dt = \int s(\phi_{p_j}(t)) \, dt = -\int s(t) \, dt.$$
If all the $p_j$ are even, then $s(t) = 1$.