We have developed a scanning photoluminescence technique that can directly map out the local two-dimensional electron density with a relative accuracy of $sim2.2times10^8$ cm$^{-2}$. The validity of this approach is confirmed by the observation of the expected density gradient in a high-quality GaAs quantum well sample that was not rotated during the molecular beam epitaxy of its spacer layer. In addition to this global variation in electron density, we observe local density fluctuations across the sample. These random density fluctuations are also seen in samples that were continuously rotated during growth, and we attribute them to residual space charges at the substrate-epitaxy interface. This is corroborated by the fact that the average magnitude of density fluctuations is increased to $sim9times10^{9}$ cm$^{-2}$ from $sim1.2times10^9$ cm$^{-2}$ when the buffer layer between the substrate and the quantum well is decreased by a factor of seven. Our data provide direct evidence for local density inhomogeneities even in very high-quality two-dimensional carrier systems.