We present time series photometry of two fields near M32 using archival observations from the Advanced Camera for Surveys Wide Field Channel on-board the Hubble Space Telescope. One field is centred about 2 arcmin from M32, while the other is located 15 arcmin to the south-east of M31. The imaging covers a time baseline sufficient for the identification and characterization of a total number of 1139 RR Lyrae variables of which 821 are ab-type and 318 are c-type. In the field near M32, we find a radial gradient in the density of RR Lyraes relative to the centre of M32. This gradient is consistent with the surface brightness profile of M32, suggesting that a significant number of the RR Lyraes in this region belong to M32. This provides further confirmation that M32 contains an ancient stellar population formed around the same time as the oldest population in M31 and the Milky Way. The RR Lyrae stars in M32 exhibit a mean metal abundance of 〈[Fe/H]〉 ≈ −1.42 ± 0.02, which is ≈15 times lower than the metal abundance of the overall M32 stellar population. Moreover, the abundance of RR Lyrae stars normalized to the luminosity of M32 in the field analysed further indicates that the ancient metal-poor population in M32 represents only a very minor component of this galaxy, consistent with the 1–4.5 per cent in mass inferred from the colour–magnitude diagram analysis of Monachesi et al. We also find that the measured reddening of the RR Lyrae stars is consistent with M32 containing little or no dust. In the other field, we find unprecedented evidence for two populations of RR Lyraes in M31 as shown by two distinct sequences among the ab-type variables in the Bailey diagram. When interpreted in terms of metal abundance, one population exhibits a peak at [Fe/H] ≈ −1.3 and the other is at [Fe/H] ≈ −1.9. One possible interpretation of this result is that the more metal-rich population represents the dominant M31 halo, while the metal-poorer group could be a disrupted dwarf satellite galaxy orbiting M31. If true, this represents a further indication that the formation of the M31 spheroid has been significantly influenced by the merger and accretion of dwarf galaxy satellites.