The following is an exercise from Spivak's Calculus, 4th Edition:
Let $\phi(x)$ be a non-negative equation such that $\phi(x)=0$ for all $x$ with $|x|>1$, and with $\int_{-1}^1\phi(x)dx=1$. For all $h>0$, define a function $\phi_h(x)=\frac{1}{h}\phi(\frac{x}{h})$. Show that $$\lim_{h\to 0^+}\int_{-1}^1\phi_h(x)f(x)dx=\lim_{h\to 0^+}\int_{-h}^h\phi_h(x)f(x)dx=f(0)$$ for all functions $f$ that are integrable and continuous at $x=0$.
My attempt: I think I have the right idea intuitively, but I don't understand how to use the limit "correctly". I first work with the first portion of the equality,
$$\lim_{h\to 0^+}\int_{-1}^1\phi_h(x)f(x)dx=f(0)$$
First, we can rewrite the expression in terms of the function $\phi$ :
$$\lim_{h\to 0^+}\int_{-1}^1\phi_h(x)f(x)dx\lim_{h\to 0^+}\int_{-1}^1\frac{1}{h}\phi(\frac{x}{h})f(x)dx$$
Now let $u=\frac{x}{h}$ with $du=\frac{1}{h}dx$. Now we have
$$\lim_{h\to 0^+}\int_{-1/h}^{1/h}\phi(u)f(uh)du=\lim_{N\to\infty}\Bigg[\lim_{h\to 0^+}\int_{-N}^{N}\phi(u)f(uh)du\Bigg]$$
Here is where I have a problem:
I would like to do something like this
\begin{align*}
\lim_{N\to\infty}\Bigg[\lim_{h\to 0^+}\int_{-N}^{N}\phi(u)f(uh)du\Bigg] & =\lim_{N\to\infty}\Bigg[f(0)\int_{-N}^N\phi(u)du\Bigg]
\\ & = f(0)\int_{-1}^1\phi(u)du
\\ & = f(0)\cdot 1=f(0)
\end{align*}
I'm pretty sure I can't simply draw the function $f$ outside of the integral, without evaluating the limit with respect to $N$. I would like to know if this is allowed, or if I am violating some rules regarding limits and integration.