Modifying the intrinsic properties of carbon nanotubes (CNTs) through functionalization is of great interest. Also, mechanical behavior is of great importance in designing and analyzing nanoelectromechanical systems (NEMS) and nanocomposites. In this research, the structural properties and buckling behavior of functionalized single- and double-walled carbon nanotubes (SWCNTs and DWCNTs) with pyrene-linked polyamide in vacuum and aqueous environments are investigated utilizing the classical molecular dynamics (MD) simulations. The gyration radius, critical force and critical strain of functionalized SWCNTs and DWCNTs are obtained and the effects of the weight percentage of functional group, radius and simulation environments on these parameters are explored. According to the results, it is observed that the gyration radius increases as the weight percentage of functional groups increases. Moreover, it is observed that the presence of water molecule in the simulation environments results in more expansion of functional group around the CNTs. Moreover, it is observed that the critical buckling force of functionalized CNTs is higher than that of pure CNTs and increases as the weight percentage increases. It is further observed that the presence of water molecules increases the critical force of functionalized CNTs, whereas its variation with the weight percentage decreases. Finally, it is demonstrated that although the critical strain of functionalized CNTs decreases, the weight percentage of functional group and the presence of water molecules do not have a considerable effect on the critical strain of functionalized CNTs. Furthermore, one can use these findings in designing and fabricating efficient NEMS and nanocomposites.