TITLE: A question about Existence of a Continuous function.
QUESTION [32 upvotes]: Let $f$ be a continuous function on the interval $[1,2]$. It follows from Stone-Weierstrass theorem that if  $\displaystyle \int_1^2x^nf(x) \, dx=0$ for integers $n=0,1,2,\ldots$, then $f$ must be identically zero. My question is,
Does there exist a non-zero  continuous function $f$ on the interval $[1,2]$, and a positive constant $M$ such that $\displaystyle \left|\int_1^2x^nf(x)\,dx\right|\leq M$  for all integers $n=0,1,2,\ldots$?
If such a function exists, it must be an oscillating function which attains both positive and negative signs. I really appreciate for any answers, comments or suggestions.

REPLY [6 votes]: No, there does not exist such a non-zero $f.$
Suppose we have such a continuous function $f.$ Define
$$g(z)=\int_0^{\ln 2} e^{-itz}f(e^t)dt$$
for $z\in\mathbb C.$ Then:

$g$ is an entire function of exponential type at most $\ln 2,$ specifically $g(z)\leq \|f\|_1 e^{(\mathrm{Im} z)\ln 2}\leq \|f\|_1 e^{|z|\ln 2}$
$g(in)=\int_1^2 x^{n-1}f(x)dx$ is bounded in absolute value: by assumption for $n\geq 1,$ and by boundedness of $f$ for $n\leq 1$
$|g(r)|\leq \|f\|_1$ for real $r$

Theorem 2 of Cartwright "On certain integral functions of order one" (https://academic.oup.com/qjmath/article-abstract/os-7/1/46/1587148?redirectedFrom=fulltext) states that if an entire function of exponential type less than $\pi$ is bounded on $\mathbb Z$ then it is bounded on $\mathbb R.$ Applying this theorem to $z\mapsto g(iz)$ shows that $g$ is bounded on the imaginary axis.
The Phragmén–Lindelöf principle states that a function of (arbitrary) exponential type that is bounded on the real and imaginary axes is bounded on the whole complex plane.
So $g$ is bounded. By Liouville's theorem, $g$ is constant. This forces $f$ to be a non-zero multiple of the Dirac delta $\delta_1,$ which is not a function let alone a continuous function.