Using Weierstrass approximation to show $f(x) = 0.$ 
(i). Let $f: [0,1] \to \mathbb{R}$ be continuous such that 
  $$\int_{0}^{1} x^kf(x)dx = 0, \ \forall k \geq 5.$$
  Show that $f(x) = 0$, for all $x \in [0,1]$. 
(ii). Let $f: [0,1] \to \mathbb{R}$ be continuous such that 
  $$\int_{0}^{1} x^{2k}f(x)dx = 0, \ \forall k \geq 1.$$
  Show that $f(x) = 0$, for all $x \in [0,1]$.

For part (i), by the Weierstrass approximation theorem, we know that there exists a sequence of polynomials such that $|x^5f(x) - p_n(x)| < \frac{1}{n}$ for large enough $n$.
By the linearity of integrals, we can conclude that 
$$\int_{0}^{1} x^{5}f(x)p_n(x)dx = 0.$$
Furthermore,
$$0 \leq \int_{0}^{1} [x^{5}(f(x))]^2 dx \leq \int_{0}^{1} x^5f(x)[p_n(x)+\frac{1}{n}]dx = 0.$$
By the continuity of $f(x)$ it follows that $f(x) = 0.$ 
For part (ii), I tried to take a similar approach by also using the Weierstrass approximation theorem. However, the sequence of polynomials that approximate $f(x)$ may potentially have odd-powered terms, which leaves me unable to conclude that
$$\int_{0}^{1} x^{2k}f(x)p_n(x)dx = 0.$$
Can I have a hint on how to proceed?   
 A: I cannot really follow what you are trying to do in your argument, nor where your inequalities come from. The way it is usually done is that because you can approximate  $x^5f(x)$ uniformly with polynomials, you get get $(x^5f(x))^2=0$, and the $f(x)=0$ by continuity. In more detail: let $\{p_n\}$ be polynomials with $p_n(x)\to x^5f(x)$ uniformly. The uniform convergence makes the integrals $0=\int_0^1 x^5 f(x)p_n(x)dx$ to converge to $\int_0^1x^5f(x)g(x)\,dx=0$. 
In part (ii), you can show that $p(x^2)\,x^2f(x)=0$ for all $p$. Now choose polynomials $\{p_n\}$, with zero constant term, that approximate uniformly the function $g(x)=x\,f (\sqrt x)$. Then
$$
0=\int_0^1p_n(x^2)x^2f(x)\,dx \to \int_0^1g (x^2)x^2f (x)\,dx=\int_0^1 x^4(f (x))^2\,dx.
$$
So $x^2f(x)=0$; this immediately implies that $f(x)=0$ for $x\ne0$, and we also get $f(0)=0$ by continuity. 
A: For part ii) we could also do this: Extend $f$ to a continuous even function $g$ on $[-1,1].$ Then we have $\int_{-1}^1 g(x)x^{2k}\, dx = 0$ from the given hypothesis, while $\int_{-1}^1 g(x)x^{2k+1}\, dx = 0$ from even/odd considerations. It follows that $\int_{-1}^1 g(x)x^{n}\, dx = 0$ for $n=0,1,2,\dots .$ Thus $\int_{-1}^1 g(x)p(x)\, dx = 0$ for all polynomials $p.$ In the usual way we then conclude $\int_{-1}^1 g(x)^2\,dx = 0,$ whence $g\equiv 0.$ That of course implies $f\equiv 0.$
