Three-dimensional topological insulators (TIs) have attracted tremendous interest for their possibility to host massless Dirac Fermions in topologically protected surface states (TSSs), which may enable new kinds of high-speed electronics. However, recent reports have outlined the importance of band bending effects within these materials, which results in an additional two-dimensional electron gas (2DEG) with finite mass at the surface. TI surfaces are also known to be highly inhomogeneous on the nanoscale, which is masked in conventional far-field studies. Here, we use near-field microscopy in the mid-infrared spectral range to probe the local surface properties of custom-tailored (Bi0.5Sb0.5)2Te3 structures with nanometer precision in all three spatial dimensions. Applying nanotomography and nanospectroscopy, we reveal a few-nanometer-thick layer of high surface conductivity and retrieve its local dielectric function without assuming any model for the spectral response. This allows us to directly distinguish between different types of surface states. An intersubband transition within the massive 2DEG formed by quantum confinement in the bent conduction band manifests itself as a sharp, surface-bound, Lorentzian-shaped resonance. An additional broadband background in the imaginary part of the dielectric function may be caused by the TSS. Tracing the intersubband resonance with nanometer spatial precision, we observe changes of its frequency, likely originating from local variations of doping or/and the mixing ratio between Bi and Sb. Our results highlight the importance of studying the surfaces of these novel materials on the nanoscale to directly access the local optical and electronic properties via the dielectric function.