Scanning probe study of a two-dimensional electron system and donor layer charging in heterostructured semiconductors