A sulfur-containing carbon nanosphere (SCN) with the corrosion inhibitor M16 (M16 @SCN) was successfully prepared through post-carbonization and then electrostatic adsorption. The as-prepared SCN have rich pore and high specific surface area of 578.9 m2g−1 due to high-temperature carbonization of polythiophene (PT), which as a nanocontainer could upload corrosion inhibitor M16 to obtain M16 @SCN. The M16 @SCN exhibits anti-corrosion performance via controlled release of M16 and improved tribological performance, with friction coefficient of 0.1, extreme pressure of 850 N, and reduction in wear volume of 88.6%. The M16 adsorbed on the nanosphere improves the dispersion of SCN in the lubricating oil, and the SCN acts as a nanocontainer to ensure the performance of M16 under harsh conditions. The good tribological properties are attributed to the synergistic effect between SCN and M16 in the friction process, resulting in a rigid protective oil film was produced on friction pair via tribochemical reactions and physical adsorption.