## d divides n and u = v (mod d) then f(u) = f(v) (mod d) -> f is polynomial over Z_n

How can I show that for any squarefree n and function f from Z_n to Z_n that has the propery that- whenever d divides n and u = v (mod d) then f(u) = f(v) (mod d) - must be a polynomial over Z_n ?