SPHEREx, selected for a NASA Medium Explorer (MIDEX) mission in February 2019, is designed to spectrally survey the entire sky using a small cryogenic wide-field telescope combined with novel (but simple) spectrometers. SPHEREx will probe the inflationary birth of the universe by studying large-scale structure, complementing surveys optimized to constrain dark energy. We will investigate the origin of water and biogenic molecules, locked in interstellar ices in the early phases of planetary system formation. We will also chart the origin and history of galaxy formation through a unique mapping method in two deep survey fields. Following in the tradition of all-sky missions such as IRAS, COBE and WISE, SPHEREx will be the first all-sky near-infrared spectral survey. During its two-year mission, SPHEREx will produce four complete all-sky maps with over a billion detected galaxies, hundreds of millions of high-quality stellar and galactic spectra, and over a million ice absorption spectra, enabling diverse scientific investigations.