  We investigate the role of mass infall in the formation and evolution of
protostars. To avoid ad hoc initial and boundary conditions, we consider the
infall resulting self-consistently from modeling the formation of stellar
clusters in turbulent molecular clouds. We show that infall rates in turbulent
clouds are comparable to accretion rates inferred from protostellar
luminosities or measured in pre-main-sequence stars. They should not be
neglected in modeling the luminosity of protostars and the evolution of disks,
even after the embedded protostellar phase. We find large variations of infall
rates from protostar to protostar, and large fluctuations during the evolution
of individuals protostars. In most cases, the infall rate is initially of order
10$^{-5}$\msun\ yr$^{-1}$, and may either decay rapidly in the formation of
low-mass stars, or remain relatively large when more massive stars are formed.
The simulation reproduces well the observed characteristic values and scatter
of protostellar luminosities and matches the observed protostellar luminosity
function. The luminosity problem is therefore solved once realistic
protostellar infall histories are accounted for, with no need for extreme
accretion episodes. These results are based on a simulation of randomly-driven
magneto-hydrodynamic turbulence on a scale of 4pc, including self-gravity,
adaptive-mesh refinement to a resolution of 50AU, and accreting sink particles.
The simulation yields a low star formation rate, consistent with the
observations, and a mass distribution of sink particles consistent with the
observed stellar initial mass function during the whole duration of the
simulation, forming nearly 1,300 sink particles over 3.2 Myr.
