  Recently, in a series of papers, we established the existence and found a
general solution for the simultaneously rotating and twisting locally
rotationally symmetric spacetimes in general relativity, which can model
inhomogeneous and dynamic astrophysical bodies. However, these spacetimes
necessarily require imperfect fluids with entropy flux. Therefore, in this
paper, we investigate the existence of these spacetimes in generic f(R)-gravity
models, where the entropy flux is generated purely by higher order curvature
effects, while the standard matter still remains a perfect fluid. However, we
transparently demonstrate here, that the symmetries of these spacetimes force
the theory to be general relativity. This is a novel study that shows how the
geometrical properties of a spacetime can be used to restrict the theories of
gravity.
