The measurement of the production of f0(980) in inelastic pp collisions at s=5.02 TeV is presented. This is the first reported measurement of inclusive f0(980) yield at LHC energies. The production is measured at midrapidity, |y|<0.5, in a wide transverse momentum range, 0<pT<16 GeV/c, by reconstructing the resonance in the f0(980)→π+π− hadronic decay channel using the ALICE detector. The pT-differential yields are compared to those of pions, protons and ϕ mesons as well as to predictions from the HERWIG 7.2 QCD-inspired Monte Carlo event generator and calculations from a coalescence model that uses the AMPT model as an input. The ratio of the pT-integrated yield of f0(980) relative to pions is compared to measurements in e+e− and pp collisions at lower energies and predictions from statistical hadronisation models and HERWIG 7.2. A mild collision energy dependence of the f0(980) to pion production is observed in pp collisions from SPS to LHC energies. All considered models underpredict the pT-integrated 2f0(980)/(π+ +π−) ratio. The prediction from the canonical statistical hadronisation model assuming a zero total strangeness content of f0(980) is consistent with the data within 1.9σ and is the closest to the data. The results provide an essential reference for future measurements of the particle yield and nuclear modification in p–Pb and Pb–Pb collisions, which have been proposed to be instrumental to probe the elusive nature and quark composition of the f0(980) scalar meson.