Let $p, q$ be two strictly-positive probability mass functions on a finite space $\Omega$. Let $X_1, X_2 \cdots, \overset{i.d.d}{\sim} q$ and $Y \sim p $. Let $f: \Omega \to \mathbb R$. Define $\omega(x) = \frac{p(x)}{q(x)}$. Show that $\frac{\sum\limits_{i=1}^nf(X_i)\omega(X_i)}{\sum\limits_{i=1}^n\omega(X_i)} \to E[f(Y)]$ almost surely.
For the definition of probability mass function, see
This is a Comprehensive exam practice problem given by our instructor but to be honest, it looks quite terrifying to me, what's the idea of how to approach and solve this problem?
Expanding on my hint a little bit: after you divide top and bottom by $n$, the top is the sample mean of $f(X) \omega(X)$ and the bottom is the sample mean of just $\omega(X)$. By SLLN both those sample means converge. What do they converge to?