How to check if a population density obeys replicator dynamics
For discrete time replicator dynamics, fitness is defined only up to a multiplicative factor. I.e. if you pick some number $k$ then $(f_1, ..., f_n)$ defines the same fitness function as $\hat{f} = (f_1/k, ..., f_n/k)$. In particular, this mean for any $p$ you can always pick a $k$ such that $\langle \hat{f} \rangle_p$ = 1. 

So using your final equation, just let $\hat{f}_i(p) = g_i(p)/p_i$.

Note that the resulting landscape $\hat{f}$ will be a relative fitness landscape and not an absolute fitness landscape. But there is no way to recover an absolute fitness landscape from the data you have. You would need information on how the population size, not just frequencies evolved for that.

As a final note: if you're trying to match this to experimental data, the discrete time approach might not always be necessary. In that case, you can try the method that I describe in this post or depending on your experimental system, you might be able to just do the game assay as we defined in this paper.