We investigate the molecular abundances in protostellar cores by solving the gas-grain chemical reaction network. As a physical model of the core, we adopt a result of one-dimensional radiation-hydrodynamics calculation, which follows the contraction of an initially hydrostatic prestellar core to form a protostellar core. Temporal variation of molecular abundances is solved in multiple infalling shells, which enable us to investigate the spatial distribution of molecules in the evolving core. The shells pass through the warm region of T ~ 20–100 K in several 104 yr and falls onto the central star in ~100 yr after they enter the region of T > 100 K. We found that the complex organic species such as HCOOCH3 are formed mainly via grain-surface reactions at T ~ 20–40 K, and then sublimated to the gas phase when the shell temperature reaches their sublimation temperatures (T ≥ 100 K). Carbon-chain species can be re-generated from sublimated CH4 via gas-phase and grain-surface reactions. HCO2+, which is recently detected towards L1527, are abundant at r = 100–2,000 AU, and its column density reaches ~1011 cm−2 in our model. If a core is isolated and irradiated directly by interstellar UV radiation, photo-dissociation of water ice produces OH, which reacts with CO to form CO2 efficiently. Complex species then become less abundant compared with the case of embedded core in ambient clouds. Although a circumstellar (protoplanetary) disk is not included in our core model, we can expect similar chemical reactions (i.e., production of large organic species, carbon-chains and HCO2+) to proceed in disk regions with T ~ 20–100 K.