If $f$ continuous with period $2\pi$, $\int_{-\pi}^\pi f(x)\cos(kx) \,\mathrm dx=0$, $\int_{-\pi}^\pi f(x)\sin(kx)\,\mathrm dx=0 $, prove $f=0$ $\def\d{\mathrm{d}}$Suppose $f$ is a continuous function of period $2\pi$ such that 
$$\int_{-\pi}^\pi f(x)\cos(kx)\,\d x=0, \quad k=0,1, \cdots\\
\int_{-\pi}^\pi f(x)\sin(kx)\,\d x=0, \quad k=1,2, \cdots$$
prove $f$ is identically zero. Give two proofs of this result.
I am learning Fourier series. I can only give one proof.
My proof:
By the assumption, we have $a_k=0$, $b_k=0$, where $a_k$ and $b_k$ are the Fourier coefficients of $f$. Clearly, $f$ is Riemann integrable on $[-\pi, \pi]$. $f(-\pi)=f(\pi)$. We have 
$$\lim_{n\rightarrow\infty}\|f-S_n\|=0,$$ where $S_n$ is the Fourier series of $f$. This implies 
$$\frac{1}{\pi}\|f\|_{L^2}=\frac{a_0^2}{2}+\displaystyle\sum_{k=1}^{\infty}(a_k^2+b_k^2)=0.$$ So, $f=0$.
However, I cannot give another proof using the theorems of Fourier series.
 A: A quite elementary proof is by contradiction. Assume that WLOG $f(0)>0$. By continuity, $f(x)>f(0)/2$ in some interval $\Delta=(-\delta,\delta)$. Then it is possible to construct trigonometric polynomials $p_k(x)$ such that 
$$
\int_{-\pi}^\pi f(x)p_k(x)\,dx\to+\infty\quad\text{as }k\to+\infty\tag{1}
$$
which makes the contradiction with all these integrals being zero by the assumption of $\hat f(n)=0$. For example, one can take
$$
p(x)=\epsilon+\cos x
$$
for small enough $\epsilon>0$ to ensure that $|p(x)|<1-\epsilon/2$ in $[-\pi,\pi]\setminus\Delta$ and set
$$
p_k(x)=p(x)^k
$$
which is going to grow within $\Delta$ and vanish outside. Some relatively simple estimations show that (1) holds.
A: Another proof can be constructed with the Fejer means. If $S_0(f)=\frac{1}{2}a_0$ and it
$$
          S_n(f) = \frac{1}{2}a_0+\sum_{k=1}^{n}a_n\cos(nx)+b_n\sin(nx), \;\; n \ge 1,
$$
then
$$
           F_n(f) = \frac{1}{n}(S_0(f)+S_1(f)+\cdots+S_{n-1}(f))
$$
converges to $f(x)$ as $n\rightarrow\infty$ at every point $x$ where $f$ is continuous.
Another proof can be constructed using the Fourier series for
$$
            g(x)=\int_{-\pi}^{x}f(t)dt
$$
This function is continuously differentiable and periodic because
$$
     g(\pi)-g(-\pi)=\int_{-\pi}^{\pi}f(t)dt = 2\pi a_0(f) = 0.
$$
Therefore the Fourier series for $g$ converges pointwise to $g$. The Fourier coefficients for $g$ are related to those of $f$. For example,
$$
    \int_{-\pi}^{\pi}g(x)\sin(nx)dx \\ = \left.-\frac{\cos(nx)}{n}g(x)\right|_{x=-\pi}^{\pi}+\frac{1}{n}\int_{-\pi}^{\pi}\cos(nx)f(x)dx \\
   = \frac{1}{n}a_n(f).
$$
The conclusion is that $a_n(g)=b_n(g)=0$ for $n \ge 1$, and, hence, $g$ is constant, which forces $0=g'(x)=f(t)-\frac{1}{2}a_0$. So $f$ is identically $0$.
A: Since $f$ is continuous and hence it is $L^2$. As all the Fourier coefficients equal to zero, the partial sum of the Fourier series of $f$=$s_N=\dfrac{1}{2\pi}\int^\pi_{-\pi} f=0$. Since the Fourier series of $L^2$ function converges in $L^2$ sense, so $\|f-s_N\|_{L^2}=\|f-0\|_{L^2}<\varepsilon$. So $f=0$.
