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?   

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.$
