Let E ⊂ C(K) be a
subspace of continuous functions defined on a compact Hausdorff space K. We
characterize those spaces for which the rational functions with denominators and
numerators from E are dense. Despite the non-linear structure of rational
functions, this characterization uses only methods from linear functional
analysis. As special cases, we recover various results on the density of Müntz
rationals.