Many important properties of granular fluids can be represented by a system of hard spheres with inelastic collisions. Traditional methods of nonequilibrium statistical mechanics are effective for analysis and description of the inelastic case as well. This is illustrated here for diffusion of an impurity particle in a fluid undergoing homogeneous cooling. An appropriate scaling of the Liouville equation is described such that the homogeneous cooling ensemble and associated time correlation functions map to those of a stationary state. In this form the familiar methods of linear response can be applied, leading to Green-Kubo and Einstein representations of diffusion in terms of the velocity and mean-square displacement correlation functions. These correlation functions are evaluated approximately using a cumulant expansion and from kinetic theory, providing the diffusion coefficient as a function of the density and the restitution coefficients. Comparisons with results from molecular-dynamics simulation are given in the following companion paper.