With the rapid development of science and technology, 5G technology will be widely used, and biosafety concerns about the effects of 5G radiofrequency radiation on health have been raised. Drosophila melanogaster was selected as the model organism for our study, in which a 3.5 GHz radiofrequency radiation (RF-EMR) environment was simulated at intensities of 0.1 W/m2, 1 W/m2, and 10 W/m2. The activity of parent male and offspring (F1) male flies was measured using a Drosophila activity monitoring system under short-term and long-term 3.5 GHz RF-EMR exposure. Core genes associated with heat stress, the circadian clock and neurotransmitters were detected by QRT-PCR technology, and the contents of GABA and glutamate were detected by UPLC-MS. The results show that short-term RF-EMR exposure increased the activity level and reduced the sleep duration while long-term RF-EMR exposure reduced the activity level and increased the sleep duration of F1 male flies. Under long-term RF-EMR, the expression of heat stress response-related hsp22, hsp26 and hsp70 genes was increased, the expression of circadian clock-related per, cyc, clk, cry, and tim genes was altered, the content of GABA and glutamate was reduced, and the expression levels of synthesis, transport and receptor genes were altered. In conclusion, long-term RF-EMR exposure enhances the heat stress response of offspring flies and then affects the expression of circadian clock and neurotransmitter genes, which leads to decreased activity, prolonged sleep duration, and improved sleep quality.