The stochastic trajectories of molecules in living cells, as well as the dynamics in many other complex systems, often exhibit memory in their path over long periods of time. In addition, these systems can show dynamic heterogeneities due to which the motion changes along the trajectories. Such effects manifest themselves as spatiotemporal correlations. Despite the broad occurrence of heterogeneous complex systems in nature, their analysis is still quite poorly understood and tools to model them are largely missing. We contribute to tackling this problem by employing an integral representation of Mandelbrot’s fractional Brownian motion that is compliant with varying motion parameters while maintaining long memory. Two types of switching fractional Brownian motion are analysed, with transitions arising from a Markovian stochastic process and scale-free intermittent processes. We obtain simple formulas for classical statistics of the processes, namely the mean squared displacement and the power spectral density. Further, a method to identify switching fractional Brownian motion based on the distribution of displacements is described. A validation of the model is given for experimental measurements of the motion of quantum dots in the cytoplasm of live mammalian cells that were obtained by single-particle tracking.