The bifunctional applications of noble metal-TiO2 heterojunctions are an interesting topic, such as antibacterial agents and chemical sensors via surface-enhanced Raman spectroscopy (SERS). The vital factor is to narrow the bandgap of TiO2 and shift the absorption wavelengths from ultraviolet to visible region. In this study, we reported the design and the fabrication of TiO2 spheres coated with an ultrathin nitrogen-doped carbon (NC) shell and subsequent loading Ag nanoparticles. This strategy endowed TiO2 spheres with a narrow bandgap (2.34 eV) and high fluorescence quenching ability. The TiO2@NC/Ag composites exhibited excellent charge transfer-induced SERS performance with high enhancement factor of 8.0 × 106 and good uniformity. The composites were further developed as a SERS sensor for rapid detection of phenformin hydrochloride in human urine with a low detection limit of 5 nM. In the antibacterial application, TiO2@NC/Ag showed a promising bactericidal feature against Escherichia coli under low-power LED (6 W) irradiation, which immensely emerged the synergistic antibacterial role of TiO2@NC and Ag. The inhibition rate under the LED irradiation for 8 h increased from 59.8% to 87.6% as compared to the rate in the dark.