Show that $\lim_{n\to\infty }\int_0^1 f(x)g_n(x)d\mu(x)=0.$ 
Consider $g_n:\mathbb R\to\{-1,1\}$ define for all $n$ by 
  $$g_n(x)=(-1)^{\lfloor nx\rfloor},$$
  show that for all $f:[0,1]\to\mathbb R$ mesurable and bounded,
  $$\lim_{n\to\infty }\int_0^1 f(x)g_n(x)d\mu(x)=0.$$

In the correction, they firstly consider $f=\chi_I$ (the characteristic function of $I$) where $I\subset [0,1]$ is an interval. I don't undertand why
$$\left|\int_{[0,1]}f(x)g_n(x)d\mu(x)\right|\leq\frac{1}{n}.$$
Notation: $\mu$ reprensent the Lebesgue measure.
 A: I finally found. So if somebody is interested:
For $n$ fixed and $x\in[0,1]$, 
$$\lfloor nx\rfloor=k\ \ \text{ if }x\in\left[\frac{k}{n},\frac{k+1}{n}\right[, k=0,...,n-1$$
and thus
\begin{align*}
\left|\int_0^1 f(x)g_n(x)\mu(dx)\right|&=\left|\sum_{k=0}^{n-1}\int_{\frac{k}{n}}^{\frac{k+1}{n}}\chi_I(x)(-1)^k\mu(dx)\right|\\
&\underset{\chi_I\ \leq\ \chi_{[0,1]}}{\leq}\left|\sum_{k=0}^{n-1}\int_{\frac{k}{n}}^{\frac{k+1}{n}}(-1)^k\mu(dx)\right|\\
&= \left|\sum_{k=0}^{n-1}(-1)^k\int_{\frac{k}{n}}^{\frac{k+1}{n}}\mu(dx)\right|\\
&= \left|\sum_{k=0}^{n-1}(-1)^k\underbrace{\mu\left(\left[\frac{k}{n},\frac{k+1}{n}\right]\right)}_{=\mu\left(\left[0,\frac{1}{n}\right]\right)}\right|\\
&=\mu\left(\left[0,\frac{1}{n}\right]\right) \underbrace{\left|\sum_{k=0}^{n-1} (-1)^k\right|}_{=0\text{ or }1}\\
&\leq\mu\left(\left[0,\frac{1}{n}\right]\right)\\
&=\frac{1}{n}
\end{align*}
A: $(-1)^{\lfloor nx\rfloor}$ is a $\frac{1}{n}$-periodic function, hence the absolute value of the last integral cannot exceed the absolute value of the same integral over a period.
