A Greens function approach to the inclusive quasielastic ($e,e$) scattering is presented. The components of the nuclear response are written in terms of the single-particle optical model Greens function. The explicit calculation of the Greens function can be avoided by its spectral representation, which is based on a biorthogonal expansion in terms of the eigenfunctions of the non-Hermitian optical potential and of its Hermitian conjugate. This allows one to treat final state interactions consistently in the inclusive ($e,e$) and in the exclusive ($e,eN$) reactions. Numerical results for the longitudinal and transverse response functions obtained in a nonrelativistic and in a relativistic framework are presented and discussed also in comparison with data.