Modified theories of gravity have recently been studied by several authors as possibly viable alternatives to the cosmological concordance model. Such theories attempt to explain the accelerating expansion of the universe by changing the theory of gravity, instead of introducing dark energy. In particular, a class of models based on higher order curvature invariants, so-called $f(R)$ gravity models, has drawn attention. In this letter we show that within this framework, the expansion history of the universe does not uniquely determine the form of the gravitational action and it can be radically different from the standard Einstein-Hilbert action. We demonstrate that for any barotropic fluid, there always exists a class of $f(R)$ models that will have exactly the same expansion history as that arising from the Einstein-Hilbert action. We explicitly show how one can extend the Einstein-Hilbert action by constructing a $f(R)$ theory that is equivalent on the classical level. Due to the classical equivalence between $f(R)$ theories and Einstein-Hilbert gravity with an extra scalar field, one can also hence construct equivalent scalar-tensor theories with standard expansion.