Visualizing individual molecules with chemical recognition is a longstanding target in catalysis, molecular nanotechnology and biotechnology. Molecular vibrations provide a valuable `fingerprint' for such identification. Vibrational spectroscopy based on tip-enhanced Raman scattering allows us to access the spectral signals of molecular species very efficiently via the strong localized plasmonic fields produced at the tip apex. However, the best spatial resolution of the tip-enhanced Raman scattering imaging is still limited to 3-15 nanometres, which is not adequate for resolving a single molecule chemically. Here we demonstrate Raman spectral imaging with spatial resolution below one nanometre, resolving the inner structure and surface configuration of a single molecule. This is achieved by spectrally matching the resonance of the nanocavity plasmon to the molecular vibronic transitions, particularly the downward transition responsible for the emission of Raman photons. This matching is made possible by the extremely precise tuning capability provided by scanning tunnelling microscopy. Experimental evidence suggests that the highly confined and broadband nature of the nanocavity plasmon field in the tunnelling gap is essential for ultrahigh-resolution imaging through the generation of an efficient double-resonance enhancement for both Raman excitation and Raman emission. Our technique not only allows for chemical imaging at the single-molecule level, but also offers a new way to study the optical processes and photochemistry of a single molecule.