For each natural number $n\geq 1$, consider the dyadic intervals partitioning the unit interval $$I_n^1=[0,1/2^{n}], ~~J_n^1=[1/2^{n},2\cdot 1/2^{n}]$$
$$I_n^2=[2\cdot 1/2^{n},3\cdot 1/2^{n}], ~~J_n^2=[3\cdot 1/2^{n},4\cdot 1/2^{n}]$$
$$...$$$$I_n^{2^{n-1}}=[(2^{n}-2)\cdot 1/2^{n},(2^{n}-1)\cdot 1/2^{n}], ~~J_n^{2^{n-1}}=[(2^{n}-1)\cdot 1/2^{n},1]$$
If $f\in L^2([0,1],\mathbb{R})$, and if $$\int_{I_n^k}f d\lambda=\int_{J_n^k}fd\lambda$$for all $k,n$, how do I show $f$ is constant a.e.?
Motivation: trying to prove that the functions $$\{\mathbb{1}_{I_n^k}-\mathbb{1}_{J_n^k} \}\cup \{\mathbb{1}_{[0,1]}\}$$ form a hilbert basis for $L^2$.