The linear electromagnetic response of a uniform three-dimensional electron gas to a longitudinal electric field is determined by the known Lindhard dielectric function ?q?. Using a similar approach, we derive exact analytical expressions for the second-order nonlinear electromagnetic response of the electron gas. We calculate the second-order polarizability a(2)q? of the system and, within the self-consistent-field approach, the second-order response function, analogous to ?q?. The best conditions for the observation of the second-harmonic generation are analyzed.