suppose p isn't one of your nks and for contradiction let (x-p) divide f(x)
then (x-p) either divides (x-nk) for some k, or (x-p) is also a factor of f(x).
Show that
a) (x-p) can't divide (x-nk) (this should be trivial); and
b) that (x-p) isn't a factor of f(x) (it's basically stated that it isn't)
and you've shown by contradiction that p must be an nk in order for (x-p) to divide f(x).
We've said nothing at all about x here so this statement holds true for all x