Although small-scale effect or thermal stress significantly impact the mechanical properties of nanobeams, their combined effects and the temperature dependence of the elastic parameters have yet to attract the attention of researchers. In the present paper, we propose a new nonlocal nonlinear Euler–Bernoulli theory to model the mechanical properties of nanobeams. We considered the small-scale effect, thermal stress, and the temperature dependence of Young’s modulus. A single-walled carbon nanotube (SWCNT) was used to demonstrate the influence of the three factors on elastic buckling and forced bending vibrations. The results indicate that thermal stress and the temperature dependence of Young’s modulus have a remarkable influence on the mechanical properties of slender SWCNTs as compared to the small-scale effect induced by the nonlocal effect. Ignoring the temperature effect of slender SWCNTs may cause qualitative mistakes.