  We prove that every smooth closed manifold admits a smooth real-valued
function with only two critical values. We call a function of this type a
\emph{Reeb function}. We prove that for a Reeb function we can prescribe the
set of minima (or maxima), as soon as this set is a PL subcomplex of the
manifold. In analogy with Reeb's Sphere Theorem, we use such functions to study
the topology of the underlying manifold. In dimension $3$, we give a
characterization of manifolds having a Heegaard splitting of genus $g$ in terms
of the existence of certain Reeb functions. Similar results are proved in
dimension $n\geq 5$.
