In the Digital Image Processing Book by Rafael C. Gonzalez and Richard E. Woods, section 4.4 "The Discrete Fourier Transform of one variable". We get $$ \tilde{F}(\mu)=\int_{-\infty}^{\infty}\tilde{f}(t)e^{-j2\pi\mu t}dt=\sum_{n=-\infty}^{\infty}f_ne^{-j2\pi\mu n\Delta T} $$ where $\tilde{f}(t)=\sum_{n=-\infty}^{\infty}f(t)\delta(t-n\Delta T)$ is the sampled function using an impulse train $\Delta T$ units apart. $\tilde{F}(\mu)$is the Fourier transform of $\tilde{f}(t)$ and $f_n=f(n\Delta T)$.
Now the authors continue:
Although $f_n$ is a discrete function, its Fourier transform $\tilde{F}(\mu)$ is continuous and infinitely periodic with period $1/\Delta T$. Therefore, all we need to characterize $\tilde{F}(\mu)$ is one period, and sampling one period of this function is the basis for the DFT.
Suppose that we want to obtain M equally spaced samples of $\tilde{F}(\mu)$ taken over the one period interval from $\mu=0$ to $\mu=1/\Delta T$. This is accomplished by taking the samples at the following frequencies: $$ \mu=\frac{m}{M\Delta T} \qquad m = 0, 1, 2, ..., M - 1 $$ Substituting this result for $\mu$ into the first equation and letting $F_m$ denote the result yields $$ F_m=\sum_{n=0}^{M-1}f_ne^{-j2\pi mn/M} \qquad m = 0, 1, 2, ..., M - 1 $$ This expression is the discrete Fourier transform we are seeking.
Now what I don't understand is the reason why they change the limits of the summation from $-\infty$ and $\infty$ to 0 and $M-1$. How can they "truncate" the summation to get this result. I really don't get it and have been struggling for days. Please explain!