Finding the equivalent filter H(u,v) in the frequency domain of a 3x3 spatial mask
Hint: $g(x,y)$ averages all pixel values around  $f(x,y)$, at 8-neighbour connectivity distance 1, except $g(x,y)$. The classical uniform $3\times 3$ average is:
$$ m(x,y) =  \frac{1}{9}\sum_{i\in[-1,0,1]}\sum_{j\in[-1,0,1]}f(x-i,y-j)\,.$$
Thus: $$9m(x,y) = 8g(x,y)+f(x,y)\,.$$
Knowing the Fourier transform of the uniform $3\times 3$ mask, and that of the identity, and using linear superposition, you should be on track.