The equilibrium conditions are analyzed for a spatially inhomogeneous ionic liquid using the density functional theory with allowance made for the second order gradient corrections. Solutions for the distribution of potential and charge density in the electric double layer at the ionic liquid/vapor interface are obtained using a parameterized total density profile normal to the surface. It is shown that taking into account the effects of the charge density gradient in the theory results in the appearance of damped oscillations of the charge density near the surface, while the double layer localized on the surface is reduced.