Under investigation in this paper is a cubic-quintic nonlinear Schrodinger equation which can describe the propagation of ultrashort pulses in an inhomogeneous optical fibre. Lax pair and conservation laws are constructed from which the integrability of the equation can be verified. Through a gauge transformation, spectral problem for the equation is converted to an Ablowitz-Kaup-Newell-Segur spectral problem. Nonautonomous solitons and breathers are derived based on the Darboux transformation (DT), while nonautonomous rogue waves are obtained via the generalized DT. Influence of the group-velocity dispersion, gain-or-loss coefficient and group-velocity coefficient on the propagation and interaction of the nonautonomous solitons, breathers and rogue waves is also discussed. The gain-or-loss coefficient influences the amplitude of nonautonomous soliton. The characteristic line and velocity for the nonautonomous soliton are dependent on the group-velocity dispersion and group-velocity coefficient, but independent of the gain-or-loss coefficient. For the second-order nonautonomous soliton, if the two spectral parameters have the same real part, the bound-state structure can be formed, and the intensity becomes amplified in the attractive procedure. There exist two types of the nonautonomous breathers. Quasi-periods for the nonautonomous breathers are given, and effects of those coefficients on the quasi-periods are also discussed: The group-velocity dispersion can influence the trajectories of the nonautonomous breathers and rogue waves, while the gain-or-loss coefficient affects the backgrounds for the nonautonomous breathers and rogue waves