This work investigates the microstructure and inclusions of a compacted graphite iron (CGI) alloyed by Ce and La rare earth (RE) elements. In our study, alloying elemental distribution and solute segregation were characterized by methods of secondary ion mass spectrometry (SIMS) and a three-dimensional atom probe (3DAP) with high sensitivity and spatial resolution. RE sulfide, MgS, carbide, and composite inclusions formed during solidification and provided heterogeneous nucleation cores for the nucleation of the graphite. Significant solute clustering in the matrix, coupled with the segregation of solute to grain boundaries, was observed. C, Mn, Cr, and V were soluted in cementite and promoted the precipitation of cementite, while Si was found to be soluted in ferrite. Cu is usually distributed uniformly in ferrite, but some Cu-rich atom clusters were observed to segregate towards the interface between the ferrite and cementite, stabilizing the pearlite. In addition, P, as a segregation element, was enriched along the boundaries continuously. The RE elements participated in the formation of inclusions, consuming harmful elements such as As and P, and also promoted the heterogeneous nucleation of the graphite and segregated, in the form of solute atoms, at its interfaces.