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.