Superhorizon effects on the gauge invariant effective energy density in f (R) gravity