In this paper we show that power-law inflation can be realized in non-minimal gravitational coupling of electromagnetic field with a general function of the Gauss– Bonnet invariant. Such a non-minimal coupling may appear due to quantum corrections. We also consider modified Maxwell-F(G) gravity in which non-minimal coupling between electromagnetic field and f (G) occurs in the framework of modified Gauss–Bonnet gravity. It is shown that inflationary cosmology and late-time accelerated expansion of the universe are possible in such a theory