You are still implicitly assuming that the function is continuous. There are a lot of nowhere-continuous functions, e.g. the sawtooth function. Or more interestingly, Conway's base13 function, which takes on every real number in every interval.
Also what about continuous non-polynomials? e.g. exponentials, logarithms, sine/cosine etc.?