In the theory of Fourier series the following expansion is known $$ \operatorname{sign}\left(\sin\left((n + 1) x\right)\right) = \frac{4}{\pi} \sum_{k = 0}^\infty \frac{\sin\left((2k + 1) (n + 1) x\right)}{2k + 1} $$
The smallest frequency in the terms of this series is in the term corresponding to $k = 0$; this frequency is $(n + 1) - 1 = n$. Therefore, for $m = 0, 1, \dots, n - 1$, the following equation is satisfied. $$ \int_{-\pi}^\pi \cos(m \theta) \sin(\theta) \operatorname{sign}\left(\sin\left((n + 1) \theta\right)\right)\ d\theta = 0 \tag{*} $$
The above is a slightly adapted excerpt from V. I. Krylov's "Approximate Calculation of Integrals" (Dover, 2005, originally published 1962, pp. 30-31).
There are two points that I don't understand.
- Why is the frequency $n$? Shouldn't it be: "$n + 1$"?
- Given that the frequency is $n$, why is equation $(*)$ valid for $m = 0, 1, \dots, n - 1$?
I will restrict my reply to answering why equation $(*)$ is valid for $m = 0, 1, \dots, n - 1$. Questions about frequency are irrelevant to the arguments below.
Preliminaries
Firstly, a couple facts from the theory of Fourier series.
[Bachman, Example 4.1.3: "Square Wave II", pp. 147-148] The Fourier series for the square wave is $$ \operatorname{sign}\left(\sin(t)\right) = \frac{4}{\pi} \sum_{n = 1}^\infty \frac{\sin\left((2n - 1)t\right)}{2n - 1} $$
[Bachman, Theorem 4.7.4: "Uniform Convergence for Piecewise Smooth Functions", p. 203] Let $f$ be a piecewise smooth $2\pi$-periodic function. Even if $f$ is not continuous, its Fourier series converges uniformly and absolutely to $f$ on every closed interval not containing a point of discontinuity of $f$.
Proof
Let $m, n \in \{0, 1, 2, \dots\}$ be such that $m < n$. If $m = 0$, the result follows by the fact that the system of functions $$ \left\{\cos(k t) :\mid k \in \{0, 1, 2, \dots\} \right\} \cup \left\{\sin(k t) :\mid k \in \{1, 2, \dots\}\right\} $$ is orthogonal over the interval $[-\pi, \pi]$.
Assume now that $m > 0$. Using the formula for the sine of a sum, we have, for every $\theta \in \mathbb{R}$, $$ \cos(m\theta)\sin(\theta) = \frac{1}{2}\left(\sin((m+1)\theta)-\sin((m-1)\theta)\right) $$
Therefore
$$ \begin{gather} \int_{-\pi}^\pi \cos(m \theta) \sin(\theta) \operatorname{sign}\left(\sin\left((n + 1) \theta\right)\right)\ d\theta = 2 \int_0^\pi \cos(m \theta) \sin(\theta) \operatorname{sign}\left(\sin\left((n + 1) \theta\right)\right)\ d\theta \\ = \underbrace{\int_0^\pi \sin\left((m+1)\theta\right)\operatorname{sign}\left(\sin\left((n + 1) \theta\right)\right)\ d\theta}_A - \underbrace{\int_0^\pi \sin\left((m - 1)\theta\right)\operatorname{sign}\left(\sin\left((n + 1) \theta\right)\right)\ d\theta}_B \end{gather} $$
We will show that $$ \int_0^\pi \sin\left(M\theta\right)\operatorname{sign}\left(\sin\left((n + 1) \theta\right)\right)\ d\theta = 0 $$ for each $M \in \{0, 1, \dots, n\}$. Hence both integrals $A$ and $B$ evaluate to zero, as desired. $$ \begin{align} \int_0^\pi \sin\left(M\theta\right)\operatorname{sign}\left(\sin\left((n + 1) \theta\right)\right)\ d\theta & = \sum_{k = 0}^n \int_{\frac{k}{n + 1} \pi}^{\frac{k + 1}{n + 1} \pi} \sin\left(M\theta\right)\operatorname{sign}\left(\sin\left((n + 1) \theta\right)\right)\ d\theta \\ & = \sum_{k = 0}^n \lim_{\varepsilon \rightarrow 0+} \int_{\frac{k}{n + 1} \pi + \varepsilon}^{\frac{k + 1}{n + 1} \pi - \varepsilon} \sin\left(M\theta\right)\operatorname{sign}\left(\sin\left((n + 1) \theta\right)\right)\ d\theta \end{align} $$
For every $k \in \{0, 1, \dots, n\}$ and every sufficiently small $\varepsilon > 0$, we have by the preliminary facts $$ \begin{align} \int_{\frac{k}{n + 1} \pi + \varepsilon}^{\frac{k + 1}{n + 1} \pi - \varepsilon} \sin\left(M\theta\right)\operatorname{sign}\left(\sin\left((n + 1) \theta\right)\right)\ d\theta &= \frac{4}{\pi} \int_{\frac{k}{n + 1} \pi + \varepsilon}^{\frac{k + 1}{n + 1} \pi - \varepsilon} \sum_{i = 1}^\infty \frac{\sin\left(M\theta\right) \sin\left((2i - 1) (n + 1) \theta \right)}{2i - 1} d\theta \\ &= \frac{4}{\pi} \sum_{i = 1}^\infty \frac{1}{2i - 1} \int_{\frac{k}{n + 1} \pi + \varepsilon}^{\frac{k + 1}{n + 1} \pi - \varepsilon}\sin\left(M\theta\right) \sin\left((2i - 1)(n + 1) \theta\right) d\theta \end{align} $$ where the last equation holds due to the uniform convergence of the integrated series. In particular, the series in the last expression converges.
Combining the last two chains of equalities, we have $$ \begin{align} \int_0^\pi \sin\left(M\theta\right)\operatorname{sign}\left(\sin\left((n + 1) \theta\right)\right)\ d\theta & = \sum_{k = 0}^n \lim_{\varepsilon \rightarrow 0+} \frac{4}{\pi} \sum_{i = 1}^\infty \frac{1}{2i - 1} \int_{\frac{k}{n + 1} \pi + \varepsilon}^{\frac{k + 1}{n + 1} \pi - \varepsilon}\sin\left(M\theta\right) \sin\left((2i - 1)(n + 1) \theta\right) d\theta \\ & = \frac{4}{\pi} \sum_{k = 0}^n \sum_{i = 1}^\infty \frac{1}{2i - 1} \int_{\frac{k}{n + 1} \pi}^{\frac{k + 1}{n + 1} \pi}\sin\left(M\theta\right) \sin\left((2i - 1)(n + 1) \theta\right) d\theta \\ & = \frac{4}{\pi} \sum_{i = 1}^\infty \frac{1}{2i - 1} \int_0^\pi\sin\left(M\theta\right) \sin\left((2i - 1)(n + 1) \theta\right) d\theta \\ & = \frac{2}{\pi} \sum_{i = 1}^\infty \frac{1}{2i - 1} \int_{-\pi}^\pi\sin\left(M\theta\right) \sin\left((2i - 1)(n + 1) \theta\right) d\theta \\ & = 0 \end{align} $$ where the second equality is due to Fatou's Lemma and the last equality is due to the fact that the system of functions $$ \left\{\cos(k t) :\mid k \in \{0, 1, 2, \dots\} \right\} \cup \left\{\sin(k t) :\mid k \in \{1, 2, \dots\}\right\} $$ is orthogonal over the interval $[-\pi, \pi]$, and to the fact that $M < n + 1$.
Q.E.D.
Work cited
[Bachman] Bachman, George, Narici, Lawrence and Beckenstein, Edward. Fourier and Wavelet Analysis. Springer 2000
Credits
The core of the proof was suggested to me by /u/Jack D'Aurizio in this answer.