The W2-curvature tensor is an important geometric invariant with relativistic significance, introduced in the early 1970s by Pokhariyal and Mishra, which can be identified in class 4 in the classification of skew-symmetric operators. In this work, we investigate 4-dimensional space-times admitting W2-curvature tensor in f(R,G) modified theory of gravity. It is proved that the W2-curvature flat perfect fluid space-times obeying f(R,G) gravity represent inflation. Also, it is shown that the isotropic pressure and the energy density of such space-times are constant. It is to be noted that in such space-times the considered energy conditions are consistently satisfied if the scalar curvature is positive. Next, we study perfect fluid space-times admitting divergence free W2-curvature tensor in f(R,G) gravity. Amongst other results, we prove that if the energy-momentum tensor of such space-times is bi-recurrent, then either the space-times represent inflation or their isotropic pressure and energy density are constants.