Let $a>1$ be a positive integer and $f\in \mathbb{Z}[x]$ with positive leading coefficient. Let $S$ be the set of integers $n$ such that $$n \mid a^{f(n)}-1.$$ Prove that $S$ has density $0$; that is, prove that $\displaystyle\lim_{n\rightarrow \infty} \frac{|S\cap \{1,...,n\}|}{n}=0$.
I have not made any improvement on this one. Help!! Thanks.