$f(x) = 100000\,{x}^{3}+200000\,{x}^{2}+100001\,x+300000$ will do.
EDIT: Note that $f(x) = 10^5 g(x) + x$, where $g(x) = x^3 + 2 x^2 + x + 3$.
The $g$ doesn't really matter, any polynomial with integer coefficients would do!
If we write $x = 10 y + j$, $y \in \{0, \ldots, 99999\}$, $j \in \{0,\ldots, 9\}$, then $g(x) \equiv g(j) \mod 10$ and $f(x) \equiv 10^5 g(j) + 10 y + j \mod 10^6$. To get any value $f(x) \equiv z \mod 10^6$, take $j$ so $j \equiv z \mod 10$, and then you just need $y \equiv (z-j)/10 - 10^5 g(j)$.
For a maybe slightly more impressive-looking example, try
$f(x) = 10 x^3 + 20 x^2 + 11 x + 30$. The reason this works is just slightly more complicated. Again, we could actually use $f(x) = 10 g(x) + x$ for any polynomial $g$ with integer coefficients.
Suppose $f(x) \equiv f(y) \mod 10^6$. Since $f(X) \equiv X \mod 10$, that implies $x \equiv y \mod 10$. Let $k$ be the greatest integer such that $x \equiv y \mod 10^k$. I claim $k \ge 6$. Since $x \equiv y \mod 10^k$,
$g(x) \equiv g(y) \mod 10^k$. Thus $f(x) - f(y) = 10 (g(x) - g(y)) + (x-y) \equiv (x-y) \mod 10^{k+1}$, so if $k < 6$ we would get $f(x) - f(y) \not \equiv 0 \mod 10^6$, contradiction.
A still more sophisticated example is $f(x) = 6 x^6 + 2 x^3 + x $. A reason this works is that on the integers mod $10$, $f$ is one-to-one with $\gcd(f'(x),10) = 1$.