What can we say about $f$ if $\int_0^1 f(x)p(x)dx=0$ for all polynomials $p$?

Assuming you're using Lebesgue integrals, to even make the statement that ${\mathbb \int_0^1 f(x)p(x) = 0}$ for all polynomials $p(x)$, you are forcing $f(x)$ to be in $L^1$. This can be seen by setting $p(x) = 1$; in order for the statement ${\mathbb \int_0^1 f(x) = 0}$ to be well-defined the positive and negative parts $f^+(x)$ and $f^-(x)$ have to integrate to the same finite value.

So suppose $f(x)$ is some $L^1$ function with ${\mathbb \int_0^1 f(x)p(x) = 0}$ for all polynomials $p(x)$. By the Stone-Weierstrass theorem you can uniformly approximate any continuous function by polynomials, so taking limits you also have ${\mathbb \int_0^1 f(x)g(x) = 0}$ for every continuous $g(x)$. In particular it is true for $g(x) = \cos(2\pi nx)$ and $g(x) = \sin(2\pi nx)$ for any $n$. This means each Fourier coefficient of $f(x)$ is zero. By the uniqueness theorem for Fourier coefficients, this means $f(x) = 0$ a.e.


  1. Yes. This follows from the fact that polynomials are dense in $L^1$, which follows from (say) Stone-Weierstrass together with the fact that continuous functions are dense in $L^1$.