Investigation of condensed matter systems with resonant inelastic X-ray scattering