We study scalar field FLRW cosmology in the content of f(R) gravity. Our consideration is restricted to the spatially flat Friedmann universe. We derived the general evolution equations of the model, and showed that the scalar field equation is automatically satisfied for any form of the f(R) function. We also derived representations for kinetic and potential energies, as well as for the acceleration in terms of the Hubble parameter and the form of the f(R) function. Next we found the exact cosmological solutions in modified gravity without specifying the f(R) function. With negligible acceleration of the scalar curvature, we found that the de Sitter inflationary solution is always attained. Also we obtained new solutions with special restrictions on the integration constants. These solutions contain oscillating, accelerating, decelerating and even contracting universes. For further investigation, we selected special cases which can be applied with early or late inflation. We also found exact solutions for the general case for the model with negligible acceleration of the scalar curvature in terms of special Airy functions. Using initial conditions which represent the universe at the present epoch, we determined the constants of integration. This allows for the comparison of the scale factor in the new solutions with that for current stage of the universe evolution in the [Formula: see text]CDM model.