Green's function approach to inclusive electron scattering