  We prove that the divisor function $d(n)$ counting the number of divisors of
the integer $n$, is a good weighting function for the pointwise ergodic
theorem. For any measurable dynamical system $(X, {\mathcal A},\nu,\tau)$ and
any $f\in L^p(\nu)$, $p>1$, the limit $$ \lim_{n\to \infty}{1\over
\sum_{k=1}^{n} d(k)} \sum_{k=1}^{n} d(k)f(\tau^k x)$$ exists $\nu$-almost
everywhere. We also obtain similar results for other arithmetical functions,
like $\theta(n)$ function counting the number of squarefree divisors of $n$ and
the generalized Euler totient function $J_s(n)$, $s>0$. We use Bourgain's
method, namely the circle method based on the shift model.
