Real Mathematical Analysis Prelim problem 4.60 I am stuck on the following problem from Pugh's book:
Does there exist a continuous function $$f: [0,1] \rightarrow \mathbb{R}$$ such that $$\int_0^1 xf(x)\,dx  = 1$$ and $$\int_0^1 x^n f(x)\,dx  = 0$$ for $$n = 0,2,3,\ldots$$
The progress I made so far is that, for any polynomial $p$, we must have $p'(0) = \int_0^1 p(x)f(x)\,dx$. Also from Cauchy-Schwarz we can deduce that $\int_0^1 f^2(x) \, dx \geq 3$. We also know that the polynomials are dense in the space of continuous functions, but I don't know how to use this fact to solve the problem.
Thank you

Let $q_n\in\mathbb{R}[X]$ such that $\|f-q_n\|_{\infty}\rightarrow 0$ and let $p_n=q_n+\frac{(1-x)^{m_n}}{m_n}q_n'(0)$ where $m_n=\lfloor|q_n'(0)|+1\rfloor^2+n+1$, then $p_n'(0)=0$ for all $n$ so that $\int_0^1 p_n(x)f(x)dx=0$ for all $n$. Moreover, $\|f-p_n\|_{\infty}\leqslant\|f-q_n\|_{\infty}+\frac{|q_n'(0)|}{m_n}\rightarrow 0$ thus, $$ \int_0^1 f(x)p_n(x)dx\rightarrow\int_0^1 f(x)^2dx $$
and therefore $\int_0^1 f(x)^2dx=0$ which means that $f=0$, $f$ being continuous. This contradicts the fact that $\int_0^1 xf(x)dx=1$.
