$\frac{1}{2^p}\sum_{k=1}^{2^p}f\biggl(\frac{k}{2^p}\biggl)=\int_0^1f(x)dx$ implies $f$ is constant We have a continuous and increasing function $f:[0,1]\to \mathbb R$ and the sequence $(a_n)_{n\ge1}$,$$a_n=\frac{1}{2^n}\sum_{k=1}^{2^n}f\biggl(\frac{k}{2^n}\biggl)$$ . Knowing that there exists $p\in \mathbb N^*$ s.t. $a_p=\int_0^1f(x)dx$, prove that f is constant.
I've found that $\int_0^1f(x)dx=a_p\ge a_{p+n}\ge \int_0^1f(x)dx $ because $a_n$ is decreasing (proof here: $a_n=\frac{1}{2^n}\sum_{k=1}^{2^n}f\biggl(\frac{k}{2^n}\biggl)$ is decreasing ) and since the integral is the limit of $a_{p+n}$, the limit has to be smaller than it.
So $a_{p+n}=\int_0^1f(x)dx ,\forall n\in \mathbb N$.
I don't know what can I do next.Can somebody help me,please? 
 A: We need the following lemma: if $g:[0,1]\to \Bbb R$ is a continuous, increasing function such that 
$$
\int_0^1 g(t)\ dt= g(1),
$$ then $g(x)=g(1)$ for all $x\in [0,1]$. Proof is simple. Since $g(1)-g(x)\ge 0$ is a continuous function with $
\int_0^1 g(1)-g(t)\ dt=0
$, it follows that $g(1)-g(x)$ is identically $0$.
Now, define $g(x) = \frac1{2^n}\sum_{k=0}^{2^n-1}f(\frac{k+x}{2^n})$. Then the given condition implies that
$$\begin{align*}
\int_0^1 g(t)\ dt &= \sum_{k=0}^{2^n-1}\frac1{2^n}\int_0^1f\left(\frac{k+t}{2^n}\right)\ dt\\&=\sum_{k=0}^{2^n-1}\int_{\frac k{2^n}}^{\frac{k+1}{2^n}}f\left(u\right)\ du\\&=\int_0^1 f(u)\ dt\\&=\frac1{2^n}\sum_{k=1}^{2^n} f\left(\frac{k}{2^n}\right)=g(1).
\end{align*}$$ Since $g$ is increasing, the lemma in particular implies that $g(0)=g(1)$, hence
$$
\sum_{k=0}^{2^n-1} f\left(\frac{k}{2^n}\right)=\sum_{k=1}^{2^n} f\left(\frac{k}{2^n}\right)\implies f(0)=f(1).
$$ Since $f$ is increasing, this implies that $f$ is constant.
A: Hints: let $g(x)=f(\frac {k-1} {2^{p}})$ if $\frac {k-1} {2^{p}} \leq x <\frac k {2^{p}}$. Verify that $f \geq g$ and $\int_0^{1} [f(x)-g(x)]\, dx=0$. Conclude that $f$ is a constant in each of the intervals $\frac {k-1} {2^{p}} \leq x <\frac k {2^{p}}$, hence on $[0,1]$. 
