  We study the effect of diffusion of ultra-high energy cosmic ray (UHECR)
protons in the presence of turbulent magnetic fields in the light of the $f(R)$
theory of gravity. The $f(R)$ theory of gravity is a successful modified theory
of gravity in explaining the various aspects of the observable Universe
including its current state of expansion. Here, we consider the two most
studied $f(R)$ gravity models, viz., the power-law model and the Starobinsky
model. For these two models, the diffusive character of the propagation of
UHECR protons is explored in terms of their density enhancement (a measure of
how the density of UHECRs changes due to their diffusion and interactions in
the intergalactic medium). Ankle, instep, and Greisen-Zatsepin-Kuzmin cutoff
are spectral characteristics that extragalactic UHECRs acquire when they
propagate through the cosmic microwave background. All these characteristics
are analysed through the diffusive flux as well as its modification factor. We
compare the UHECR protons spectra calculated for the considered $f(R)$ gravity
models with the available data of the Telescope Array and Pierre Auger
Observatory. Both models of $f(R)$ gravity predict energy spectra of UHECRs
with all experimentally observed features, which lay well within the range of
combined data of both experiments. However, this work is only to investigate
the possible effects of $f(R)$ gravity theory on the UHECRs propagation, using
pure proton composition as a simplified case study. At this stage, our results
cannot be used to favour or disfavour the $f(R)$ cosmology over the
$\Lambda$CDM cosmology.
