Dynamical Density Response Function of a Metal Film in the Random-Phase Approximation