Partial sums minimize the mean-square error
Before asking whether the series converges, ask a softer, geometric question: among all trigonometric polynomials of degree N, which one is closest to f in the mean-square sense? In a Hilbert space the answer is forced: the closest point in a subspace is the orthogonal projection, and its coordinates are the Fourier coefficients. So the partial sum S_N f is the best degree-N approximation, full stop.
Use the orthonormal tones e_n (the cos/sin scaled to unit norm) and write c_n = ⟨f, e_n⟩.
Let S_N = sum_{n=0}^{N} c_n e_n be the partial sum, and let T = sum_{n=0}^{N} d_n e_n be ANY degree-N trig polynomial.
Compute the squared error, using ⟨e_m, e_n⟩ = 0 for m != n and = 1 for m = n (Pythagoras):
‖f - T‖^2 = ‖f‖^2 - 2 Re ⟨f, T⟩ + ‖T‖^2
= ‖f‖^2 - 2 Re sum d_n^* c_n + sum |d_n|^2 (expand the inner products)
= ‖f‖^2 - sum |c_n|^2 + sum |c_n - d_n|^2. (complete the square)
The first two pieces do not depend on the choice of T. The last piece sum |c_n - d_n|^2 >= 0,
and is ZERO exactly when d_n = c_n for all n.
=> ‖f - T‖^2 is minimized precisely by T = S_N. The Fourier partial sum is the best L^2 fit. QEDBessel's inequality: energy is bounded
Set T = S_N in the identity above; since ‖f − S_N‖² ≥ 0, the partial energy sum_{n≤N} |c_n|² ≤ ‖f‖² for every N. Letting N → ∞ gives Bessel's inequality: sum of |c_n|² ≤ ‖f‖². Two free gifts: the coefficient series converges, and (by the n-th term test) c_n → 0 — a foretaste of the Riemann–Lebesgue lemma.
Parseval: equality, and completeness
Bessel becomes the equality Parseval's identity sum |c_n|² = ‖f‖² exactly when the trig system is complete — when no nonzero function is orthogonal to every tone. Equivalently, ‖f − S_N‖ → 0: the series converges to f in the mean. For every square-integrable f this holds, and the Riesz–Fischer theorem supplies the converse: every square-summable coefficient sequence is the Fourier series of some L² function.