Why does the fact that $f$ and $g$ have the same Fourier coefficients imply that $f=g\text{ a.e.} $ I am self-learning Rudin's RCA and I encountered a puzzle that struggled me for a long time. Here is the related text from RCA and my question.

Suppose now that $f\in L^1(T)$, that $\{c_n\}$ is given by $ c_n = \frac{1}{2\pi} \int_{-\pi}^\pi f(x)e^{-inx} \, dx$, and that $\sum_{-\infty}^\infty |c_n|<\infty$. Put $g(x)=\sum_{-\infty}^\infty c_n e^{inx}$.
We can get that the series $g(x)$ converges uniformly by  $\sum_{-\infty}^\infty |c_n|<\infty$ (hence $g$ is continuous), and the Fourier coefficients of $g$ are easily computed. Through the computation, we know that $f$ and $g$ have the same Fourier coefficients. This implies $f=g\text{ a.e.}$, so the Fourier series of $f$ converges to $f(x)\text{ a.e.}$

My question is in the very last line: why the fact that the Fourier coefficients of $f$ and $g$ are equal implies that $f=g\text{ a.e.}$?
Guess 1: I am aware that if $f$ and $g$ are continuous, then this implication can follow. So, we may use that $C(T)$ is dense in $L^1(T)$ to try to solve this question. But I am stuck with the $\epsilon$ thing.
Guess 2: Is it true that if a function's Fourier series converges pointwise, then the series must converge (pointwise a.e.) to the original function? If yes, then we can say that the Fourier series of $f$ converges pointwise to $g$, and $g$ is equal to $f\ a.e.$ by the above guess.
 A: I would break the proof into several steps.
Step 1: if $f \in C(T)$, then the Fourier series of $f$ is uniformly Cesaro summable to $f$
The $N$ th-Cesaro sum of the Fourier series is defined as
$$
\sigma_N f := \frac{1}{N} \sum_{n = 0}^{N-1} S_N f
\quad \text{where} \quad
S_N f = \sum_{n = -N}^N \hat{f}(n) e^{inx}
$$
It is a routine exercise to prove $\sigma_N f = f * F_N$, where $F_N$ is the Fejer kernel:
$$
F_N(x) = \frac{ \sin^2 (Nx/2) }{ N \sin^2 (x/2) }
$$
The sequence of Fejer kernels $\{F_N\}_{N=1}^\infty$ is an approximate identity in the sense that:

*

*$ \int_T F_N(x) dx = 1 $ for all $N$

*$ \sup_N ||F_N||_{L^1} < \infty $

*for any $\delta > 0$, we have $$ \lim_{N \to \infty} \int_{T \setminus \{|x| < \delta\} } |F_N(x)| dx = 0 $$
It is a well-known theorem in Fourier analysis that if $f \in C(T)$ and $\{F_N\}_{N=1}^\infty$ is an approximate identity, then $f * F_N$ converges to $f$ uniformly. Thus, the Fourier series of $f$ is uniformly Cesaro summable to $f$.
Step 2: The trigonometric polynomials are dense in $C(T)$
It is another routine exercise to prove the following identity:
$$
\sigma_N f  = \sum_{n=-N}^N \left( 1 - \frac{|n|}{N} \right) \hat{f}(n) e^{inx}
$$
which implies $ \sigma_N f \in \operatorname{span}\{e^{inx} : n \in \mathbb{Z}\}$. But by step 1, $\sigma_N f$ converges to $f$ uniformly for any $f \in C(T)$. Thus, the subspace $ \operatorname{span}\{e^{inx} : n \in \mathbb{Z}\} $ is dense in $C(T)$ in the uniform norm.
Step 3: if $f \in C(T)$ and $\hat{f}(n) = 0$ for all $n$, then $f = 0$
The assumption $\hat{f}(n) = 0$ for all $n$ implies
$$ \int_T \overline{f(x)} e^{inx} dx = 0 \quad \forall n $$
which further implies $ \int_T \overline{f(x)} p(x) dx = 0 $ for any trigonometric polynomials $p$.
Let $f \in C(T)$ and $\epsilon > 0$. By step 2, there exists a trigonometric polynomials $p_\epsilon$ such that $ ||f - p_\epsilon||_\infty < \epsilon $. Thus,
\begin{align*}
\int_T |f(x)|^2 dx
&= \int_T \left( \overline{f(x)} (f(x) - p_\epsilon(x)) + \overline{f(x)} p_\epsilon(x) \right) dx \\
&= \int_T \overline{f(x)} (f(x) - p_\epsilon(x)) dx \\
&\leq \int_T |\overline{f(x)}| ||f - p_\epsilon||_\infty dx \\
&\leq \epsilon ||f||_{L^1}
\end{align*}
Since $||f||_{L^1} < \infty$ and $\epsilon > 0$ is arbitrary, $ \int_T |f(x)|^2 dx = 0$. By continuity, we have $f = 0$.
Step 4: if $f \in L^1(T)$ and $\hat{f}(n) = 0$ for all $n$, then $f = 0$ a.e.
In this case, define $ F(x) = \int_{-\pi}^x f(t) dt $ for $ -\pi \leq x \leq \pi $. Clearly, we have
$$ \int_T \int_{-\pi}^x |f(t) e^{-inx}| dt dx
= \frac{1}{2\pi} \int_{-\pi}^\pi \int_{-\pi}^x |f(t)| dt dx < \infty $$
This allows us to use Fubini theorem to compute
\begin{align*}
\hat{F}(n) &= \frac{1}{2\pi} \int_{-\pi}^\pi \left( \int_{-\pi}^x f(t)dt \right) e^{-inx} dx \\
&= \frac{1}{2\pi} \int_{-\pi}^\pi \int_t^\pi f(t) e^{-inx} dx dt \\
&= \frac{1}{2\pi} \int_{-\pi}^\pi f(t) \frac{e^{-int} - (-1)^n}{in} dt \\
&= \frac{\hat{f}(n) - (-1)^n \hat{f}(0)}{2\pi in} = 0
\end{align*}
Since $F$ is absolutely continuous, we have $F = 0$ by step 3. Finally, by Lebesgue differentiation theorem, $f = F' = 0$ a.e.
A: From the comments and the other answer there is a consensus that Cesàro summability of Fourier series is a  good way to think about this situation.
Here is another way to express this (without a detour through continuous functions).  It is standard and what is used in the reference [1] (a general real analysis text)  as well as many specialized textbooks on Fourier series.

*

*Definition.   A point $x_0$ is said to be a Lebesgue point of a Lebesgue integrable function $f$ if
$$ \lim_{h\to 0} \frac1h \int_{x_0}^{x_0+h} |f(x)-f(x_0)|\,dx = 0.$$
[see Definition 7.40 in [1].]


*Theorem.  Almost every point is a Lebesgue point of an integrable function. [See Theorem 7.41 in [1]]


*Theorem. The Cesàro means of the Fourier series for any Lebesgue integrable function converge to the value of that function at every point that is a Lebesgue point for the function. [See Theorem 15.5 in [1]]


*Corollary.  If the Fourier series of an integrable function happens to converge almost  everywhere it must converge almost everywhere to that function.
This is because convergence of any series implies convergence of the Cesàro means to the same value.


*Theorem.  If two integrable functions $f$ and $g$ have the same Fourier coefficients then $f=g$ a.e.

Proof.  The function $h=f-g$ has every Fourier coefficient zero and the Fourier series for $h$ must have its Cesàro means converging to zero at every Lebesgue point of $h$.  Consequently $h=0$ a.e. and so $f=g$ a.e.
[See Theorem 15.8 in [1]]


*Cautionary example:  There is an abundance of Lebesgue integrable functions whose Fourier series diverge at every point.

This is due to Kolmogorov [2].  For a follow-up to this, if you are interested, make sure to read Olevskiĭ's [3] tribute to Kolmogorov.

REFERENCES:
[1]  http://classicalrealanalysis.info/documents/BBT-AlllChapters-Landscape.pdf
[2]  Kolmogorov, A. N.: Une série de Fourier-Lebesgue divergente partout, Comptes Rendus, 183, 1327-1328 (1926).
[3] Olevskiĭ, A.  Kolmogorov's theorems in Fourier analysis. Geometric aspects of functional analysis.  199–218. Oper. Theory Adv. Appl., 77, Birkhäuser, Basel, 1995.
A: The hypothesis $\sum |\widehat{f}(n)|<\infty$ implies $\sum |\widehat{f}(n)|^2<\infty$, and we can think in terms of the Parseval theorem that $\int_0^{2\pi}|f(t)|^2\,dt=\sum |\widehat{f}(n)|^2$ (up to a normalizing constant).
Applying this to $f-g$ gives $\int_0^{2\pi}|f(t)-g(t)|^2\,dt=0$. From definitional properties of integrals, this entails that $f-g$ is $0$ almost everywhere.
