Say I have a continuous function $f$ defined on a compact interval $I$ on the real line. As is well-known, I could approximate $f$ arbitrarily well by polynomials, i.e., we can express $f$ as an infinite series $\sum c_n x^n$. 

Question: given $R>0$, can we express $f$ as an integral $\int_0^R x^r d\mu(r)$? If not, how well can we approximate $f$ by an integral of that form?

(Note I put no requirements on what $\int_0^R x^r d\mu(r)$ has to be for $x\notin I$ -- otherwise the answer to the first question would certainly be "no" in general.)