Necessary and suficient condition for a sequence of $L^2([0,1])$ to be a basis. Let $\{f_n\}$ be an orthonormal set in the Hilbert space $L^2([0,1])$ over the reals. Show that $\{f_n\}$ is a basis if and only if $\sum_{n=1}^{\infty}\int _{[0,x]}f_n(t)dt=x, \forall x\in [0,1]$
I begun with the assumption that $\{f_n\}$ is a basis and want to prove the above equality. Since the functions $\chi _{[0,x]}\in L^2([0,1])$ for every $x\in [0,1]$, by Parseval's identity we get that $\sum (\int_{[0,x]}f_n(t)dt)^2=x, \forall x\in [0,1]$. Is there a mistake with the exercise?

Parseval's identity states that
$$ \|g\|^2 = \sum_n\langle g, f_n\rangle^2 $$
Therefore 
$$ x= \int_0^1 \chi_{[0,x}^2(s)\, ds = \sum_n\bigg(\int_{[0,x]} f_n(s)\, ds\bigg)^2  $$
Which is not the equality you have at hand. 
Take the Haar basis (https://en.wikipedia.org/wiki/Haar_wavelet) and consider 
$$g = \chi_{[0,1]}  $$
$$g = \frac{f_1 + f_0}{2}  + \frac{1}{2}\bigg(\frac{ f_0 - f_1  }{2} + \frac{1}{\sqrt{2}}f_3\bigg) = \frac{3}{4} f_0 + \frac{1}{4}f_1  + \frac{1}{2\sqrt{2}}f_3  $$
$$ \frac{3}{4} =  \bigg(\frac{3}{4}\bigg)^2 + \bigg(\frac{1}{4}\bigg)^2  + \bigg(\frac{1}{2\sqrt{2}}\bigg)^2  $$
But if you compute
$$\sum_n\int_{[0,x]} f_n = \langle g , f_n \rangle = \frac{3}{4} + \frac{1}{4} + \frac{1}{2\sqrt{2}}  \neq \frac{3}{4}$$
So yes, the exercise is wrong
