Fourier series of a measurable function Let $f: [0,2\pi] \to \mathbb{R}$ be a bounded Lebesgue measurable function that satisfies $\int_{0}^{2\pi}f(x)\sin( kx) = 0$ and $\int_{0}^{2\pi}f(x)\cos( kx) = 0$ for every $k\in \mathbb{N}$. It is my guess that this implies $f$ is constant almost everywhere.
However, I have much trouble proving it or finding an counter-example.  The only relevant result which I can think of is that the Fourier series of a continuous function $f$ on closed interval converges pointwise almost everywhere to $f$. So if we make the stronger assumption of $f$ being continuous (instead of just measurable), the statement should be true.
I would appreciate any thoughts whether the original guess is indeed true, and if so, how to go about proving it.
 A: Hint
Let $g(x)=f(x)-a_0$. Show that the Parseval Identity for $g$ gives
$$
\int_{0}^{2\pi} |g(x)|^2 d x=0
$$
Deduce from here that $g=0$ almost everywhere.
A: The answer is "$f$ is constant almost everywhere".
Define $a_0 = \int_{0}^{2\pi} f(t) dt$.
Define $g:[0,2\pi] \rightarrow \mathbb{R}$ by $g(t)= f(t) - a_0$.
Then all Fourier coefficients of $g$ are zero.
Since Fourier-Stieltjes transform is injective, so $g =0$ almost everywhere, and hence $f$ is constant almost everywhere.
It was a difficult question asked by a lot of mathematicians in the 19th century: If the Fourier transform of $g$ is zero (for your case, i.e., on the circle group $\mathbb{T}$, all Fourier coefficients are zero), must $g$ be zero (in some sense)?
Obviously, if we modify $g$ on a set of measure zero, all Fourier coefficients are unaffected because they are defined by integrals. Therefore, the question only makes sense if two functions are identified iff they are equal almost everywhere.
If I remember correctly, this problem was solved by Cantor (or Lebesgue?).
When Cantor tried to solve this problem, he considered various subsets of $[0,2\pi]$ on which $g$ can be non-zero but all Fourier coefficients are zero. This sparked the development of set theory and point-set topology.
For a rigorous proof, you may consult any textbooks about Fourier Analysis, search for the theorem which states that "Fourier-Stieltjes transform is injective". A rigorous proof requires a lot of preparation, so there is no few lines proof.
A: Let
$$
S_{n}(x)=\sum_{m=-n}^{n} \hat{f}(m)\left[\frac{1}{\sqrt{2 \pi}} e^{i m x}\right]
$$
Note $\{\frac{e^{i m x}}{\sqrt{2 \pi}}\}_{m\in \mathbb{Z}} $ is an equivalent base to cos/sen form.
Then it can be proved that Fejer sums $f_N = \frac{1}{2 N+1} \sum_{n=-N}^{N} S_{n}(x)$ converge almost uniformly to $f$ on $[0,2 \pi] .$ If only $\hat{f}(0)\neq0$, then it follows that
$$
f_N \xrightarrow{a.u.} f = S_0 = \frac{\hat{f}(0)}{\sqrt{2 \pi}} \equiv constant
$$
