How to deduce the relation of two sets from specific integrals on them? 
$\def\d{\mathrm{d}}$Suppose that $A_1$ and $A_2$ are measurable sets contained in $[0, 1]$. If there exist $0 \leqslant a_1 < a_2 < \cdots$ such that\begin{align*}
\int_{A_1} x^{a_n} \,\d x = \int_{A_2} x^{a_n} \,\d x, \quad \forall n \in \mathbb{N}_+
\end{align*}
is it necessarily true that $m(A_1 \setminus A_2) = m(A_2 \setminus A_1) = 0$? (Here $m(\,·\,)$ is the Lebesgue measure on $\mathbb{R}$.)

My progress so far:
If $m(A_1 \setminus A_2) = 0$ or $m(A_2 \setminus A_1) = 0$, the assertion is true since $y = x^{a_1}$ is a continuous function on $(0, 1]$. So next it can be assumed that $m(A_1 \setminus A_2) > 0$ and $m(A_2 \setminus A_1) > 0$.
Now, if $A_1$ and $A_2$ are “seperated,” i.e. there exists $x_0 \in (0, 1)$ such that$$
\begin{cases}
m(A_1 \setminus [x_0, 1]) = 0\\
m(A_2 \setminus [0, x_0]) = 0
\end{cases} \text{ or } \begin{cases}
m(A_1 \setminus [0, x_0]) = 0\\
m(A_2 \setminus [x_0, 1]) = 0
\end{cases}
$$
(assuming the first scenario for simplicity), and if $\lim\limits_{n → ∞} a_n = +∞$, then the assertion can be proved as below: Since $m(A_2 \setminus [0, x_0]) = 0$ and $m(A_2 \setminus A_1) > 0$ imply that$$
m(A_2 \setminus (A_1 \cup [0, x_0])) > 0,
$$
then the regularity of Lebesgue measure implies that $A_2 \setminus (A_1 \cup [0, x_0])$ contains an open interval $(x_1, x_2)$. Thus\begin{gather*}
\frac{x_0^{a_n + 1}}{a_n + 1} = \int_0^{x_0} x^{a_n} \,\d x \geqslant \int_{A_1} x^{a_n} \,\d x\\
= \int_{A_2} x^{a_n} \,\d x \geqslant \int_{x_1}^{x_2} x^{a_n} \,\d x = \frac{1}{a_n + 1} (x_2^{a_n + 1} - x_1^{a_n + 1}),
\end{gather*}
which implies that$$
\left( \frac{x_0}{x_1} \right)^{a_n + 1} \geqslant \left( \frac{x_2}{x_1} \right)^{a_n + 1} - 1. \quad \forall n \geqslant 1
$$
But making $n → ∞$ yields a contradiction.

Update 1: The reasoning above is false as is explained in @zhw's (deteled) answer.
Update 2: I would also award the bounty to any answer that proves the assertion in details with additional but mild assumptions on $\{a_n\}$.
 A: This is not an aswer but an extended comment: You wrote "the regularity of Lebesgue measure implies that $A_2 \setminus (A_1 \cup [0, x_0])$ contains an open interval $(x_1, x_2)$". That is not true. There are sets of positive measure containing no interval.
But we can fix your proof for the "separated" case: WLOG $A_1\subset [0,a),A_2\subset (a,1]$ and both sets have positive measure. Suppose we have
$$\int_{A_2}x^p \,dx = \int_{A_1}x^p \,dx$$
for an unbounded set of positive $p.$
Now there exists $a<b<1$ such that $[b,1]\cap A_2$ has positive measure. Thus
$$\tag 1 b^p\cdot m([b,1]\cap A_2)\le\int_{A_2}x^p \,dx .$$
As you had,
$$\tag 2\int_{A_1}x^p\,dx\le \frac{a^p}{p+1}.$$
Since $b>a,$ it is easy to see that
$$\frac{a^p}{p+1} < b^p\cdot m([b,1]\cap A_2)$$
for large $p.$ This is a contradiction, so there can be no "separated" sets $A_1,A_2$ of positive measure that have your property.
A: Theorem: Take $S \subseteq \mathbb{N}$. Then the linear span of $\{1\}\cup\{x^n : n \in S\}$ is uniformly dense in $C([0,1])$ if and only if $\sum_{n \in S} \frac{1}{n} = +\infty$.
This is called the Muntz-Statz theorem (or something like that) and can be found in Lax's functional analysis book.
I don't know how I can provide any more details on how this theorem implies, for your problem, that $A_1=A_2$ up to null sets if $\sum_n \frac{1}{a_n} = +\infty$. The general fact is that if $f_1,f_2$ are measurable and $\int f_1(x)g(x)dx = \int f_2(x)g(x)dx$ for all $g$ in a dense family of $C([0,1])$, then $f_1 = f_2$ a.e.. Here's one such proof of that very well-known fact: link. The proof I would give is to just look at $g$ a continuous approximation of a dirac delta.
A: Set $x=e^{-|y|}  $
$B_1=\{y: e^{-|y|} \in A_1 \}$
$B_2=\{y: e^{-|y|} \in A_2 \}$
$ \int_{[0,1]}1_{A_1}x^{a_n}dx =\int_{[0,\infty]}1_{B_1}e^{-|y|}e^{-a_n|y|}dy$
If $\int_{[0,\infty]}1_{B_1}e^{-|y|}e^{-a_n|y|}dy =\int_{[0,\infty]}1_{B_2}e^{-|y|}e^{-a_n|y|}dy$
$$a_n\int_{[0,\infty]}((1_{B_1}-1_{B_2})e^{-|y|}e^{-a_n|y|}dy=0$$
set $g(y)=(1_{B_1}-1_{B_2})e^{-|y|}$
$a_n\int_{[0,\infty]}g(y)e^{-a_n|y|}dy=a_n\int_{[-\infty,0]}g(y)e^{-a_n|y|}dy=0$
so $$\lim_{a_n \to \infty}2a_n\int_{[-\infty,\infty]}g(y)e^{-a_n|y|}dy=0$$
If we let the measure $v_n(S)=\int_Se^{-n|y|}dy$ on a measurable set $S$
Then $$\lim_{n\to \infty}\frac{\int_{[-\epsilon,\epsilon]}g(y)dv_n}{v_n([-\epsilon,\epsilon])}=0$$
This implies the sets $B_1$ and $B_2$ cannot be seperated and also implies sets $A$ and $B$ cant be seperated
