  An ultralight axion around $10^{-23}$ eV is known as a viable dark matter
candidate. A distinguished feature of such a dark matter is the oscillating
pressure which produces the oscillation of the gravitational potential with
frequency in the nano-Hz range. Recently, Khmelnitsky and Rubakov pointed out
that this time dependent potential induces the pulse arrival residual and could
be observed by the Square Kilometre Array (SKA) experiment. In this paper, we
study the detectability of the oscillating pressure of the axion in the
framework of $f(R)$ theory, and show that the amplitude of the gravitational
potential can be enhanced or suppressed compared to that in Einstein's theory
depending on the parameters of the $f(R)$ model and mass of the axion. In
particular, we investigate the Hu-Sawicki model and find the condition that the
Hu-Sawicki model is excluded.
