  We investigate the observational constraints on the modified gravity, which
combines the $R^{2-q}$ inflation with the power-law (exponential) type of the
viable $f(R)$ dark energy models. We discuss the difference between the
combined model and $R^{2-q}$ gravity in the inflationary epoch and obtain the
constraints on the deviation power $q$ as well as the parameters in $f(R)$ by
using the CosmoMC package. The allowed ranges of the spectral index and
tensor-to-scalar ratio from the Planck data are highly restricted, resulting in
$q < 2.66 \times 10^{-2}$ and $2.17 \times 10^{-2}$ for the power-law and
exponential types of $f(R)$ gravity, respectively.
