Here are some thoughts, not an answer.
For a polynomial $p$, let $||p||_{[1]}$ denote the sum of the absolute value of its coefficients.
.
Claim: If $\{p \text{ polynomial} : ||p||_{[1]} \le \frac{1}{2}\}$ is dense in $L^2([1,2])$, then there is no nonzero $L^2$ function $f$ with $|\int_1^2 x^n f(x)dx| \le 1$ for each $n \ge 0$.
Proof: Suppose otherwise; let $f$ be a counterexample with $||f||_2 = 1$. Then $|\int_1^2 p(x)f(x)dx| \le ||p||_{[1]}$ for each polynomial $p$. So, if the hypothesis of the claim were true, we may take some polynomial $p$ with $||p||_{[1]} \le \frac{1}{2}$ and $||f-p||_2 < \frac{1}{2}$ to obtain $1 = |\int_1^2 f(x)^2dx| \le |\int_1^2 f(x)[f(x)-p(x)]dx|+|\int_1^2 f(x)p(x)dx| \le ||f||_2||f-p||_2+||p||_{[1]} < 1$, a contradiction.
.
I'm not sure whether $\{p \text{ polynomial} : ||p||_{[1]} \le \frac{1}{2}\}$ is dense in $L^2([1,2])$. I'm not even sure whether the constant function $1$ is in the closure.
Here are some thoughts for trying to show that there is no such $f$ in the Wiener algebra (defined below).
By multiplying $f$ by $x-1$, we may assume $f(1) = 0$. Therefore, since obviously $f(2) = 0$, $f$ is $1$-periodic. Hence, the fourier transform $\hat{f}(k) := \int_1^2 f(x)e^{-2\pi i kx}dx$ is meaningful, e.g. we get $f(x) = \sum_{k \in \mathbb{Z}} \hat{f}(k)e^{2\pi ikx}$. If $f$ is in the Wiener algebra, i.e., if $\sum_{k \in \mathbb{Z}} |\hat{f}(k)| < \infty$, the condition $|\int_1^2 x^n f(x)dx| \le 1$ for all $n \ge 0$ translates to $|\sum_{k \in \mathbb{Z}} \hat{f}(k)I_{n,k}| \le 1$ for all $n \ge 0$, where $I_{n,k} = \int_1^2 x^ne^{2\pi i kx}dx$ (we needed $\sum_{k \in \mathbb{Z}} |\hat{f}(k)|$ to interchange the integral and the series).
Here's where I'm getting a bit out of my league. I'm not sure if there is some matrix $(B_{k,n})_{\substack{k \in \mathbb{Z} \\ n \ge 0}}$ such that $(B_{k,n})(I_{n,k}) = Id$, i.e., $\sum_{n \ge 0} B_{k,n}I_{n,k'} = \delta_{k=k'}$. If there is, then to disprove the existence of $(\hat{f}(k))_{k \in \mathbb{Z}} \in l^1(\mathbb{Z})$ with $|\sum_{k \in \mathbb{Z}} \hat{f}(k)I_{n,k}| \le 1$ for each $n \ge 0$, it suffices to show that whenever $(a_n)_{n \ge 0}$ lives in $[-1,1]^{n \ge 1}$, it holds that $(B_{k,n})(a_n) \not \in l^1(\mathbb{Z})$.
So, does anyone know how to invert the matrix $(\int_1^2 x^n e^{2\pi i kn}dx)_{\substack{n \ge 0 \\ k \in \mathbb{Z}}}$, if at all possible?