  A model of the density distribution in the intergalactic medium, motivated by
that found in numerical simulations, is used to demonstrate the effect of a
clumpy IGM and discrete sources on the reionization of the universe. In an
inhomogeneous universe reionization occurs outside-in, starting in voids and
gradually penetrating into overdense regions. Reionization should not be sudden
but gradual, with a continuous rise of the photon mean free path over a fair
fraction of the Hubble time as the emissivity increases. We show that a
hydrogen Gunn-Peterson trough should be present at $z\simeq 6$ unless the
emissivity increases with redshift at $z>4$. However, the epoch of overlap of
cosmological \hii regions could have occurred at a higher redshift if sources
of low luminosity reionized the IGM; the Gunn-Peterson trough at $z\sim 6$
would then appear because even the most underdense voids have a large enough
neutral fraction in ionization equilibrium to be optically thick to \lya
photons. Cosmological \hii regions near the epoch of overlap can produce gaps
of transmitted flux only if luminous quasars contributed to the reionization.
Despite the clumpiness of the matter distribution, recombinations are not very
important during the reionization of hydrogen because the high density gas is
not ionized until a late time. We show that the \heii reionization was most
likely delayed relative to the hydrogen reionization, but should be completed
by $z\sim 3$, the redshift where observations are available. The reported large
optical depth fluctuations of \heii are probably not due to an incomplete \heii
reionization, but arise from a combination of density fluctuations and the
variations in the intensity of the ionizing background due to luminous QSO's.
