Here is a sketch of the proof. I believe you can fill in the details to complete the proof:
Assumption. $f$ is integrable on $[0,1]$ and satisfies $\int_{0}^{1}x^{2n}f(x)\,\mathrm{d}x=0$ for all $n\geq 0$.
Then by noting that the space of even polynomials on $[0,1]$ is dense in $C([0,1])$ w.r.t. the supremum norm, we have $\int_{0}^{1}\varphi(x)f(x)\,\mathrm{d}x=0$ for any continuous function $\varphi$ on $[0, 1]$. Now observe:
Lemma. Let $E\subseteq[0,1]$ be measurable. Then there exists a sequence of $\varphi_n:[0,1]\to[0,1]$ of continuous functions such that $\varphi_n \to \mathbf{1}_E$ almost everywhere.
Using this, we can find a sequence $\varphi_n : [0, 1] \to [-1, 1]$ of continuous functions such that $\varphi_n \to \operatorname{sign}(f)$ a.e. Then by the dominated convergence theorem,
$$ 0
= \lim_{n\to\infty} \int_{0}^{1} \varphi_n(x) f(x) \, \mathrm{d}x
= \int_{0}^{1} \lim_{n\to\infty} \varphi_n(x) f(x) \, \mathrm{d}x
= \int_{0}^{1} |f(x)| \, \mathrm{d}x, $$
which is sufficient to conclude the desired claim.
Addendum - Proof of Lemma.
1st Proof. Since $C([0,1])$ is dense in $L^1([0,1])$, there exists $(\psi_n)_{n\geq 1} \subseteq C([0, 1])$ such that $\psi_n \to \mathbf{1}_E$ in $L^1$. By passing to a subsequence if necessary, we can also assume that this convergence is pointwise a.e. Then the claim follows setting $\varphi_n = \max\{0, \min\{\psi_n, 1\}\}$. $\square$
In case OP is not familiar to $L^p$-theory, here is a more elemtary proof:
2nd Proof. Pick a closed set $F_n$ such that $F_n \subset E$ and
$$ \mu(E \setminus F_n) < 2^{-n}.$$
Then there exists a continuous function $\varphi_n : [0, 1] \to [0, 1]$ such that $\varphi_n \equiv 1$ on $F_n$ and
$$\mu(\operatorname{supp}(\varphi_n) \setminus F_n) < 2^{-n}. $$
For instance, set $\varphi_n(x) = \max\{0,1-k \operatorname{dist}(x, F_n)\}$ for a sufficiently large $k$. Now we claim that $\varphi_n \to \mathbf{1}_E$ almost everywhere. We will establish this by invoking the idea of Borel-Cantelli Lemma. Indeed, define the function $N : [0, 1] \to \mathbb{N}_0 \cup\{\infty\}$ by
$$ N(x) = \sum_{n=1}^{\infty} \mathbf{1}_{\{ \varphi_n(x) \neq \mathbf{1}_E(x) \}}. $$
Then we note that, for each $x \in [0, 1]$ and $n \geq 1$, we have
\begin{align*}
[\varphi_n(x) \neq \mathbf{1}_E(x)]
&\quad\Rightarrow\quad [x \in E \text{ and } \varphi_n(x) \neq 1] \text{ or } [x \notin E \text{ and } \varphi_n(x) \neq 0] \\
&\quad\Rightarrow\quad [x \in E \setminus F_n] \text{ or } [x \in \operatorname{supp}(\varphi_n)\setminus E].
\end{align*}
From this, we get
$$ \int_{[0,1]} N(x) \, \mathrm{d}x
= \sum_{n=1}^{\infty} \mu(\{ x : \varphi_n(x) \neq \mathbf{1}_E(x) \})
\leq \sum_{n=1}^{\infty} 2^{-(n-1)} < \infty. $$
In particular, this implies that $N$ is finite a.e., which in turn tells that $\varphi_n(x) = \mathbf{1}_E(x)$ eventually holds a.e. Therefore $\varphi_n \to \mathbf{1}_E$ pointwise a.e. as desired. $\square$