  We study the ultralight axion dark matter with mass around $10^{-22}$ eV in
$f(R)$ gravity which might resolve the dark energy problem. In particular, we
focus on the fact that the pressure of the axion field oscillating in time
produces oscillations of gravitational potentials. We show that the oscillation
of the gravitational potential is sensitive to the model of gravity.
Remarkably, we find that the detectability of the oscillation through the
gravitational wave detectors can be significantly enhanced due to the nonlinear
resonance between the ultralight axion and the scalaron.
