Just as adjacent pulses were combined to produce a step function, continuous sections can be joined to produce a piecewise continuous function. Thus it is sufficient to consider g, a function that is continuous over part of the domain from 0 to 2π, and zero elsewhere.
continuous on a closed interval implies uniformly continuous. Thus, for any ε, a step function whose widths are no more than δ, is uniformly within ε of g. Call this uniformly convergent sequence fn(x).
Each fn has a uniformly convergent fourier series. Let the coefficients of each series be the nth row of an infinite matrix. The first row defines the series for f1, the second row defines the series for f2, and so on.
The coefficient on sin(x) is a particular column in this matrix. In each case it is equal to the integral of fn(x)×sin(x), divided by some constant. As we move down the matrix, fn is uniformly within ε of g, and with sine bounded by 1, fn(x)sin(x) is uniformly within ε of g(x)sin(x). Therefore the coefficient on sin(x), as we move down the column of the infinite matrix, approaches a limit determined by the integral of g(x)×sin(x).
The above reasoning holds for all coefficients, hence the converging step functions define a new fourier series, which can be viewed as the bottom row of the infinite matrix. However, the resulting fourier series need not converge to g. Continuous functions can still be very wiggly at the microscopic level, like the function that is everywhere continuous and nowhere differentiable. This can throw off the high frequency terms of the series. However, the series converges to g when g is analytic. In fact g only need be continuously differentiable. Unfortunately I don't have a proof for this at the moment. I'll write more on this subject later.
Put these pieces (finitely many) together to find a uniformly convergent fourier series for any function that is piecewise c1. At a jump discontinuity, the series converges to the average of the left and right limits. This is consistent with the step functions that approach g.
The same process works in higher dimensions.