Coefficients in the Fourier series for any periodic square-integrable function $f(x)$ form a countable (though infinite) set, i.e., they have cardinality $\aleph_0$. As far as Fourier exponents form a basis in the corresponding Hilbert space $L^2([0,T])$, we may say that any basis of this space is countable.
On the other hand, the initial function $f(x)$ is described by an infinite and uncountable set of values—for each $x$. This set has cardinality $2^{\aleph_0}$.
How to resolve this contradiction?
P.S. May the resolution be connected to the fact that $f(x)$ may be discontinuous only at the set of points with zero measure to belong to the Hilbert space $L^2([0,T])$? So we actually need a countable number of function values to deduce the values at missing points, so that the deduced function has zero difference—in the sense of the norm in $L^2([0,T])$—from the initial function and thus has the same Fourier series? We may construct countable $x$ by mapping rational values to the interval $[0,T]$.
To sum it up:
- why $f(x) \in L^2([0,T])$ is initially described with uncountable set of values, but $L^2([0,T])$ has a countable basis
- is it because we may restore a function with the same Fourier series (coordinates in a basis) through initial function values at countable $x$
The problem, as you hinted at, is that for $L_2[0,T]$ to be a Hilbert space, you have to let its elements be almost everywhere equivalence classes of functions on $[0,T]$, not the functions themselves. Otherwise, the positive definiteness axiom of Hilbert spaces $(\langle f,f\rangle=0\iff f=0$) would be violated. Though you make continuum ($2^{\aleph_0}$) many choices when specifying a square integrable function on $[0,T]$ (at each $t$, you choose $f(t)$), you only make countable many such choices to specify its equivalence class (for each $\sin(kx),\cos(kx)$, you choose its coefficient in the Fourier series).