Given a continuous function $f:\mathbb{R}\to\mathbb{R}$, define the sequence $f_{n}(x)=\frac{n}{2}\int_{x-\frac{1}{n}}^{x+\frac{1}{n}}f(t)dt$. Show that the sequence $\{f_{n}\}_{n=1}^{\infty}$ converges uniformly to $f$ on every finite closed interval $\left[a,b\right]$.
I tried to show that for all $\epsilon>0$ there exists an $N>0$ such that for all $n\ge N$, and for all $x \in \left[a,b\right]$, $|f_{n}(x)-f(x)|<\epsilon$. $f(x)=\frac{n}{2}\int_{x-\frac{1}{n}}^{x+\frac{1}{n}}f(x)dt$, as a result, $|f_{n}(x)-f(x)|=|\frac{n}{2}(\int_{x-\frac{1}{n}}^{x+\frac{1}{n}}(f(x)-f(t))dt|$. I tried to use that any continuos function is uniformly continuous on a compact interval $\left[a,b\right]$. Thus $f$ is uniformly continuous on any $\left[a,b\right]$. This implies that for all $\epsilon>0$ there exists a $\delta>0$ such that for all $t,x\in\left[a,b\right]$, $|t-x|<\delta$ implies that $|f(t)-f(x)|<\epsilon$ The main issue that made me looking at the walls disappointedly is that $t\in \left[x-\frac{1}{n},x+\frac{1}{n}\right]$ may not always be in $\left[a,b\right]$. If it were I would say that $|f_{n}(x)-f(x)|<\epsilon$ after some $N>0$ and probably done.I do not know how I can handle this issue without being dependent on the variable $x$. I am highlighting that already know that the convergence can not be uniform on the whole $\mathbb{R}$ as a question on this website by using the counterexample $e^{x}$. Therefore I am not asking the same question.I do not accept the terms and policy behind the decision of closing this question. This is exactly too personal decision like one person or group governs a country for underdeveloped countries, I do not want to assume this for this website