Terahertz (THz) time-domain spectroscopy and imaging techniques on a nanoscale are crucial for material research, device detection, and others. However, traditional far-field THz time-domain spectroscopy faces inherent diffraction limitations, which limits the applications of carrier dynamics analysis that require femtosecond time resolution and nanoscale spatial precision. We present a scattering-type scanning near-field optical microscopy that overcomes these limitations by combining ultrafast THz time-domain spectroscopy with atomic force microscopy (AFM). The utilization of the near-field interaction between the needle tip and the sample surface is demonstrated to facilitate the study of semiconductor materials and devices by using static THz spectroscopy with a lateral spatial resolution of ~60 nm. This, in turn, enables the acquisition of static THz conductivity distributions of the semiconductor materials. Additionally, it facilitates the acquisition of transient conductivity distributions of semiconductor materials and laser THz emission ultrafast via photoexcited transient carrier kinetic processes, which provides substantial support for studying the performances of materials and devices in nanometer spatial resolution, ultrafast time resolution, and THz spectroscopic imaging. The experimental results show that the system has a signal-to-noise ratio as high as 56.34 dB in the static THz time-domain spectral mode, and can effectively extract the fifth-order harmonic signals covering the 0.2–2.2 THz frequency band with a spatial resolution of up to ~60 nm. Carrier excitation and complexation processes in topological insulators are successfully observed by optical pump-THz probe with a time resolution better than 100 fs. Imaging of SRAM samples by the system reveals differences in THz scattering intensity due to non-uniformity in doping concentration, thereby validating its potential application in nanoscale defect detection. This study not only provides an innovative means for studying the nanoscale electrical characterization of semiconductor materials and devices, but also opens a new way for applying the THz technology to interdisciplinary subjects such as nanophotonics and spintronics. In the future, by integrating the superlens technology, optimizing the probe design, and introducing deep learning algorithms, it is expected to further improve the temporal- and spatial-resolution and detection efficiency of the system.