Is it possible to interchange the order of limits in this case? I'm stuck on this problem.
Let $g \in C^{\infty}(\mathbb{R})$ with $|x|^p  |D^{q} g| \rightarrow 0$ as $|x| \rightarrow \infty$ for any nonnegative integers $p$ and $q$. 
Suppose that $|g(\gamma)| \leq (1+\gamma^2)^{-1}$ for $\gamma \in \mathbb{R}$. 
Show that $$\lim_{N\rightarrow\infty} \lim_{T\rightarrow\infty}\sum_{|n|\leq NT} \frac{1}{T}g\left(\frac{n}{T}\right) = \lim_{T\rightarrow\infty}\lim_{N\rightarrow\infty}\sum_{|n|\leq NT} \frac{1}{T}g\left(\frac{n}{T}\right).$$
It is just interchange of the order of limits. But how can we guarantee this equality? 
Any help will be appreciated! 
**(edit) I've checked that 
$$ \lim_{T\rightarrow\infty}\sum_{|n|\leq NT} \frac{1}{T}g\left(\frac{n}{T}\right) = \int_{-N}^N g(\gamma) \, d\gamma,$$
so that $$\lim_{N\rightarrow\infty}\lim_{T\rightarrow\infty}\sum_{|n|\leq NT} \frac{1}{T}g\left(\frac{n}{T}\right) = \int_{-\infty}^{\infty} g(\gamma) \, d\gamma. $$
 A: Let us look at the RHS. Since $|g(x)| \le C_1 (1+x^2)^{-1}$, the series is absolutely convergent and 
$$ \lim_{N \to \infty} \sum_{|n|\leq NT} \frac{1}{T}g\left(\frac{n}{T}\right) =  \sum_{n \in \mathbb{Z}} \frac{1}{T}g\left(\frac{n}{T}\right) = \int_{\mathbb{R}} g_T(x) \, dx, $$
where $g_T$ is a piecewise constant approximation of $g$: 
$$ g_T(x) = g(n/T) \quad \text{for } \frac{n}{T} \le x < \frac{n+1}{T}, \ n \in \mathbb{Z}. $$ 
We can assume that $|g'(x)| \le C_2 (1+x^2)^{-1}$ for $x \in \mathbb{R}$. Due to the Lagrange mean value theorem, for any $\frac{n}{T} \le x < \frac{n+1}{T}$ we can choose $\theta \in [n/T,x]$ such that $g(x)-g(n/T) =(x-n/T) g'(\theta)$. Since $|\theta| \ge |x|-1$ and $|x-n/T| \le 1/T$, 
$$ |g_T(x)-g(x)| \le |x - \frac{n}{T}| \cdot |g'(\theta)| \le \frac{1}{T} \cdot C_2(1+(|x|-1)^2)^{-1}. $$
Thus obtained function is integrable on $\mathbb{R}$, hence 
$$ \left| \int_{\mathbb{R}} g_T(x) \, dx - \int_{\mathbb{R}} g(x) \, dx \right| 
\le \frac{C_2}{T} \int_{\mathbb{R}} \frac{dx}{1+(|x|-1)^2} 
\xrightarrow{T \to \infty} 0. $$
This means that both sides are in fact equal to $\int_{\mathbb{R}} g(x) \, dx$. 
