I've been always confused Fourier transforms on lattices because some times a continuous version is used and others a discrete version is used. I don't understand well when should use one or the other. What is the reason for using one or the other in each situation, e.g. when there are periodic boundary conditions or when the system is infinite, or if the system is finite?
As an example in the book "Quantum Field Theory approach to condensed matter physics" in the first chapter the Fourier transform of the density distribution is shown as
$$f (X) = \sum_q f(q) \exp(i q X) \, ,$$
yet, when they show the inverse Fourier transform a few equations later they show
$$f(Q) = \int_V f(X) \exp(-iQX) d^3X \, .$$
Why is it a continuous integral for the inverse but not for the first one? Any help with this question would be greatly appreciated or any source explaining this for several distinct cases would be helpful.