We briefly review ground-based (sub)millimeter dust continuum observations of the prestellar core mass function (CMF) and its connection to the stellar initial mass function (IMF). We also summarize the first results obtained on this topic from the Herschel Gould Belt survey, one of the largest key projects with the Herschel Space Observatory. Our early findings with Herschel confirm the existence of a close relationship between the CMF and the IMF. Furthermore, they suggest a scenario according to which the formation of prestellar cores occurs in two main steps: 1) complex networks of long, thin filaments form first, probably as a result of interstellar MHD turbulence; 2) the densest filaments then fragment and develop prestellar cores via gravitational instability.