The low masses of M dwarfs create attractive opportunities for exoplanet radial-velocity (RV) detections. These stars, however, exhibit strong stellar activity that may attenuate or mimic planetary signals. We present a velocimetric analysis on one such M dwarf, GJ 3998 (d=18.2pc), with two published short-period super-Earths: GJ 3998 b and GJ 3998 c. We use additional data from the HARPS-N spectrograph to confirm these two planets and to look for more. We carry out joint modelling of: (i) RV planetary signals, (ii) stellar rotation in RV and activity indicators through Gaussian processes, (iii) long-term trends in RV and activity indicators. We constrain the rotational period of GJ 3998 to Prot=30.2+/-0.3d and discover long-term sinusoidal imprints in RV and FWHM of period Pcyc=316^+14^-8_d. We confirm GJ 3998 b and GJ 3998 c, and detect a third planet: GJ 3998 d, whose signal had been previously attributed to stellar activity. GJ 3998 d has an orbital period of 41.78+/-0.05d, a minimum mass of 6.07^+1.00^-0.96_M_{Earth} and a mean insolation flux of 1.2^+0.3^-0.2_{PHI}{Earth}. This makes it one of the few known planets receiving Earth-like insolation flux.