  In this work, we reconstruct the cosmological unified dark fluid model
proposed previously by Elkhateeb \cite{Elkhateeb:2017oqy} in the framework of
$f(R)$ gravity. Utilizing the equivalence between the scalar-tensor theory and
the $f(R)$ gravity theory, the scalar field for the dark fluid is obtained,
whence the $f(R)$ function is extracted and its viability is discussed. The
$f(R)$ functions and the scalar field potentials have then been extracted in
the early and late times of asymptotically de Sitter spacetime. The ability of
our function to describe early time inflation is also tested. The early time
scalar field potential is used to derive the slow roll inflation parameters.
Our results of the tensor-to-scalar ratio $r$ and the scalar spectral index
$n_s$ are in good agreement with results from Planck-2018 TT+TE+EE+lowE data
for the model parameter $m > 2$.
