Proving that $f(x)=0$ in all points of continuity if $f$ is orthogonal to all polynomials Suppose that the function $f$ is:
1) Riemann integrable (not necessarily continuous) function on $\big[a,b \big]$;
2) $\forall n \geq 0$ $\int_{a}^{b}{f(x) x^n} = 0$ (in particular, it means that the function is orthogonal to all polynomials).
Prove that $f(x) = 0$ in all points of continuity $f$.
 A: Because $f$ is a 2-norm limit of polynomials, you can deduce that $\int_a^bf(x)^2=0$. 
Now suppose that $f(x_0)\ne0$ for some $x_0$ where $f$ is continuous. Take $\varepsilon=|f(x_0)|/2$; by continuity at $x_0$, there exists $\delta>0$ such that $|f(x)-f(x_0)|<|f(x_0)|/2$ for all $x\in (x_0-\delta,x_0+\delta)$. From the reverse triangle inequality we have 
$$
|f(x_0)|-|f(x)|<|f(x_0)|/2,
$$
so $|f(x)|>|f(x_0)|/2$. Then 
$$
\int_a^b f(x)^2\geq\int_{x_0-\delta}^{x_0+\delta}f(x)^2\geq\int_{x_0-\delta}^{x_0+\delta}f(x)^2\geq\int_{x_0-\delta}^{x_0+\delta}f(x_0)^2/4=\delta f(x_0)^2/2>0,
$$
a contradiction. So $f(x_0)=0$. 
A: If you know something about Fourier analysis, you can use the Fejer kernel and the following to conclude that $f=0$ at all points of continuity:
$$
             \int_{a}^{b}f(x)e^{-isx}dx = \sum_{n=0}^{\infty}\frac{(-is)^n}{n!}\int_{a}^{b} f(x)x^n dx = 0,\;\;\; s\in\mathbb{R}.
$$
A: To keep the notation simple, suppose $f$ is Riemann integrable on $[-1,1],$ $f$ is continuous at $0,$ and $ \int_{-1}^1 p(x)f(x)\, dx =0$ for all polynomials $p.$ We want to show $f(0)=0.$
Suppose, to reach a contradiction, that this fails. Then WLOG $f(0)>0.$ By the continuity of $f$ at $0,$ there exists $0<\delta < 1$ such that $f>f(0)/2$ in $[-\delta,\delta].$
Define $p_n(x) = \sqrt n(1-x^2)^n.$ Then
$$|\int_{\delta}^1 fp_n|\le M\sqrt n(1-\delta^2)^n.$$
The right hand side $\to 0$ as $n\to \infty.$ Same thing for the integral over $[-1,-\delta].$
On the other hand, for large $n$ we have 
$$\int_{-\delta}^{\delta} fp_n \ge (f(0)/2)\int_{-\delta}^{\delta} \sqrt n(1-x^2)^n\, dx \ge (f(0)/2)\sqrt n\int_{0}^{1/\sqrt n} (1-x^2)^n\, dx$$ $$ = \int_0^1 (1-y^2/n)^n\,dy \to \int_0^1 e^{-y^2}\,dy >0.$$
This proves that $\int_{-1}^1 p_n(x)f(x)\, dx >0 $ for large $n,$ and we have our contradiction.
