In view of growing interest in long range scalar forces in the early universe to generate primordial black holes, we study in detail the general relativistic formulation of a Fermi gas interacting with a scalar field in cosmology. Motivated by long range forces, we mainly focus on the cosmological massless limit of the scalar field. In this limit, our main finding is that the Yukawa interaction leads to a solution where the scalar field oscillates around zero fermion mass and all energy densities decay as radiation. On one hand, we show that if the Fermi gas starts relativistic, it could stay relativistic. On the other hand, if the fermions are initially non-relativistic, they remain non-relativistic for all practical purposes. We find that in both cases the energy density of the fermions and the scalar field decays as radiation. In the non-relativistic case, this is due to an oscillating and decaying effective mass. Such background dynamics questions whether there is a substantial enhancement of the fermion density fluctuations in the non-relativistic case. Our work can be easily extended to more general field dependent fermion mass and to general scalar field potentials. The analysis of the cosmological perturbations will be presented in a follow-up work.