When does the Fourier series equal the original function? I believe the function must be continuous and periodic, and the Fourier series must converge uniformly and absolutely. Is this correct?
Would $f(x) = |x|$ equal its Fourier series?
 A: This is not an easy question - it turns out pointwise convergence of Fourier series is a very fiddly topic.
There are many theorems giving sufficient conditions, which cover a wide class of functions. One useful theorem is:

Theorem (Dirichlet, 1829) Suppose $f$ is bounded, piecewise continuous (has finitely many points of discontinuity), and piecewise monotonous (increases or decreases between a finite number of local minima and maxima). Then for every $x$, the Fourier series converges at $x$, to the value $$\frac{f(x^{+})+f(x^-)}{2}$$
where $f(x^\pm)$ represent the limits from the right and left, respectively.

If we let $f(x)$ be the periodic extension of $\text{abs}(x)$ on, say, $[-\pi, \pi]$ then all the conditions are satisfied. Moreover $f$ is continuous, so the left and right limits are always equal to $f(x)$, thus the Fourier series converges to $f$ everywhere.
From this theorem we can also see it is not necessary for $f$ to be continuous, nor for the Fourier series to converge uniformly. Take, for example
$$ f(x) = \begin{cases}1 & 0 < x \le \pi \\ 1/2 & x= 0 \\ 0 & -\pi \le x < 0 &\end{cases}$$
By Dirichlet's Theorem this function is equal to its Fourier series. However $f$ is discontinuous. And this discontinuity gives rise to the Gibbs phenomenon, preventing uniform convergence.
For a undergraduate-level guide to the many results about the pointwise convergence of Fourier series, I recommend Fourier Analysis by T. W. Körner - specifically the first 19 chapters.
A: Here is a supplement to @FlipTack's answer.  A bit advanced, but the general ideas can be sketched.

*

*As he says, pointwise convergence of a Fourier series for $f$ to all values of the function does not demand continuity, at least not continuity everywhere. [Such a function would, however, have to be continuous at "most" points, i.e., at the points of a dense $\cal G_\delta$.]


*Conversely continuity is not enough.  The Fourier series of a continuous function can diverge on a large set. You evidently need continuity plus some strong other conditions.


*Dirichelet [as the other answer indicates] brought attention to functions with finitely many jump discontinuities and that behaved very nicely and appropriately for the 1800's:  monotonic in a finite number of pieces.  At a jump discontinuity $x_0$ you could replace the value of the function $f(x_0)$ with the average value $\frac12(f(x_0)+f(x_0-))$, and then you would have convergence to the function everywhere.


*A good setting for this question then is not "continuous functions" but regulated functions.  These are defined to be those functions with right and left hand limits everywhere.  Such functions have only a countable number of jump  discontinuities. Dirichelet worked with only a finite number of jump discontinuities  and had to assume those strong requirments about monotonicity.
So maybe this is the question which enlarges the scope from continuous functions to the more natural regulated functions:
What extra properties must a regulated function $f$ have so that the Fourier series of $f$ converges pointwise at any $x_0$ to $f(x_0)$ at every point of continuity and to the average $\frac12(f(x_0)+f(x_0-))$ at any of the jump discontinuities.
There is a very interesting key to working with this.
If the Fourier series of a regulated function $f$ diverges at some point, then there is a sequence of pairwise disjoint intervals $\{(a_n,b_n)\}$  such that $$\sum_{n=1}^\infty \frac1n |f(b_n)−f(a_n)|=\infty.$$
This observation is due to Casper Goffman and Dan Waterman from the 1960s.  When you look at it you are "reminded" of Dirichelet's condition and can appreciate why he needed some kind of assumption to avoid this possibility.
Here is the paper to read for technical details (allowing me to pay tribute to a late friend who was an inspiration and influence on a generation of real analysts):

Goffman, Casper. Everywhere convergence of Fourier series.
Indiana Univ. Math. J. 20 (1970/71), 107–112.

From the Math Review: The author obtains results on the everywhere convergence of the Fourier series of regulated functions that satisfy
certain generalized conditions of bounded variation. (Regulated
functions are those for which right and left limits exist at every
point.) By basing his proofs on a single fundamental fact, the author
unifies known results involving different types of generalized bounded
variation conditions. Also, known results are extended from continuous
functions to regulated functions, although everywhere convergence
takes the place of uniform convergence.
The proofs are based on the  fact that, if the Fourier series of a
regulated function diverges at some point, then there is a sequence of
pairwise disjoint  intervals $(a_n,b_n)$ such that

$$∑_{n=1}^\infty
  n^{-1}|f(b_n)−f(a_n)|=∞.$$

The proof of this fact given in the paper   depends on a
generalization to regulated functions of a theorem of the   author and
D. Waterman [Proc. Amer. Math. Soc. 19 (1968), 80–86;   MR0221193],
although the author has since discovered a more direct   proof.
$f$ is said to be of bounded $Φ$-variation if it satisfies the usual
definition of bounded variation, except that the numbers
$|f(x_i)−f(x_{i−1})|$ are replaced by
$Φ\left(|f(x_i)−f(x_{i−1})|\right)$. R. Salem [Essais sur les séries
trigonométriques, Hermann, Paris, 1940; MR0002656; correction, MR 2,
p. 419] has proved that if $f$ is continuous and of bounded
$Φ$-variation and $∑Ψ(1/n)<∞$, where $Φ$ and $Ψ$ are associated in the
sense of W. H. Young, then the Fourier series of $f$ converges
(uniformly) everywhere. This result is extended to regulated functions
by an easy application of a theorem involving Köthe spaces. The Köthe
space theorem is an immediate consequence of the basic fact of the
paper.

