In Gerald Teschl's Mathematical Methods in Quantum Mechanics, the author mentions the following Smoothing Lemma (0.19):
Let $u_n(x)$ be a sequence of non-negative continuous functions on $[-1, 1]$ such that $\displaystyle{\int_{|x| \leq 1} u_n(x) dx = 1}$ and $\displaystyle{\int_{\delta \leq |x| \leq 1}u_n(x) dx} \to 0, \delta > 0$.
Then for every $f \in C[-1/2, 1/2]$ which vanishes at the endpoints, $f(-1/2) = f(1/2) = 0$, we have that,
$f_n(x) = \displaystyle{\int_{-1/2}^{1/2} u_n(x - y)f(y) dy}$
converges uniformly to $f(x)$.
In my attempted proof, sketched below, I could not see the use for vanishing at the endpoints. Please point out if I've made a mistake.
Proof (My Attempt): For fixed $n, \delta$, denote $\gamma = \displaystyle{\int_{\delta \leq |x| \leq 1} u_n(x) dx} \geq 0$; from the hypothesis, for any $\delta > 0, \gamma \to 0$ as $n \to \infty$.
Also since $f$ is continuous on a compact interval $[-1/2, 1/2]$, $f$ is bounded, say by $M$. Then for fixed $x$ consider the integral $I$ for $f_n(x)$. By continuity, given $E$, we can find $\Delta > 0$ such that $|f(x) - f(y)| < E$ for $|x - y| < \Delta$. Specifically $f(y) < f(x) + E$ for all $y \in [x - \Delta, x + \Delta]$. Pick $\Delta = \delta$ so that $\newcommand{\e}{\epsilon} \newcommand{\d}{\delta} \newcommand{\g}{\gamma} E < \e/2$, for arbitrary $\e > 0$. Also for this $\d$ pick $n$ so that $\g < \e/2M$. Then the said integral $I$ satisfies,
$\displaystyle{I < \underbrace{M\g}_{\text{for regions} |x - y| \geq \d } + \underbrace{(f(x) + E)(1 - \g)}_{\text{for regions} |x - y| < \d}}$
so $I - f(x) < M\g - f(x)\g + E(1 - \g) < M\g + E < \e$.
And so, since $\e$ and $x$ was arbitrary (and crucially, $\delta = \Delta$ does not depend on $x$ as $f$ is uniformly continuous (as it is continuous on a compact interval), this holds for all $x, \e$, proving the uniform continuity?
N.B.: I realize I did not talk about the part where $I - f(x) > -\e$, if my mistake lies in there (i.e., the proof for that fact is not similar to the one shown), please let me know as well.
You should be careful with signs, and try to work with absolute values instead. Also, always put indices to indicate dependencies : $\gamma_n$ rather than just $\gamma$. That said, one cannot remove the hypothesis that $f$ vanishes at endpoints.
One can write:
$$f_n(x)-f(x)= \int_{|y-x|\geq \delta, y\in [-1/2,1/2]} u_n(x-y)f(y)dy +\int_{|y-x|< \delta,y\in [-1/2,1/2] }u_n(x-y)(f(y)-f(x))dy + f(x) \left( \int_{|y-x|<\delta,y\in [-1/2,1/2]}u_n(x-y)dy-1 \right),$$ so
$$|f_n(x)-f(x)|\leq \int_{|y-x|\geq \delta} M u_n(x-y)dy + \epsilon + M \left| \left( \int_{|y-x|<\delta,y\in [-1/2,1/2]}u_n(x-y)dy-1 \right)\right|,$$ but the last term may fail to go to zero if $x=-1/2$ (or $1/2$), since in this case we are integrating $$\int_{-1/2}^{-1/2+\delta}u_n(-1/2-y)dy=\int_{-\delta}^{0} u_n(z)dz,$$ that may contain only half the mass of $u_n$ (if $u_n$ is even, for example).