After defining $C^\infty$, $C^\infty_c$, and $L^1_\text{loc}$ for complex functions on $R^1$, the exercise asks you, for $f\in L^1_\text{loc}$ and $g\in C^\infty_c$, to prove that $f * g\in C^\infty$. I had no problem proving that. It goes on "Prove that there are sequences $\{g_n\}$ in $C^\infty_c$ such that $$||f * g_n-f||_1\to 0$$ as $n\to\infty$, for every $f\in L^1$." I have no problem doing that either. Then comes "Prove that $\{g_n\}$ can also be so chosen that $(f*g_n)(x)\to f(x)$ a.e., for every $f\in L^1_\text{loc}$; in fact for suitable $\{g_n\}$ the convergence occurs at every point $x$ at which $f$ is the derivative of its indefinite integral." There's more after that, but this is where I have some trouble.
Since we will be convolving functions with compact support with functions in $L^1_\text{loc}$, we will always be dealing with $\chi_Kf\in L^1$ for some compact set $K$ and $f\in L^1_\text{loc}$, so from here on, (with one little exception), I will not worry about $L^1_\text{loc}$ and just work with $L^1$.
I started with what it means for $f(x)$ to be the derivative of its indefinite integral. For $f\in L^1$, Rudin defines (in theorem 7.11) $$F(x)=\int_{-\infty}^xf\,dm\qquad(-\infty<x<\infty).$$ It is inconvenient to integrate on a non-compact interval, so for $f\in L^1_\text{loc}$, I'll define $$F(x)=\int_0^xf\,dm\qquad(-\infty<x<\infty).$$ Then the condition $f(x)=F'(x)$ amounts to $$f(x)=\lim_{n\to\infty}\frac{n}{2}\int_{x-1/n}^{x+1/n}f(y)\,dy=\lim_{n\to\infty}(\frac{n}{2}\chi_{[-1/n,1/n]}*f)(x).$$ This already looks very much like the answer, except that $G_n=\frac{n}{2}\chi_{[-1/n,1/n]}$ does not belong to $C^\infty_c$. It does, however, look very much like what Lang (in Real and Functional Analysis) calls a Dirac sequence with shrinking support. (Lang asks that such functions be continuous, but all that's really needed (I claim) is that they be bounded.) In particular, we have that $$\int_{-\infty}^\infty\frac{n}{2}\chi_{[-1/n,1/n]}(y)\,dy=1.$$
So, I try to approximate $G_n$ with a $C^\infty_c$ function, using the technique outlined in Lang Real Analysis 2nd Edition Chapter 11 Lemma 9.4 (or Lang Real and Functional Analysis 3rd Edition Chapter VI Lemma 9.4). It starts with the $C^\infty_c$ function $$e^{-\frac{1}{(t-a)(b-t)}}$$ where $a<b$, and integrates it from $-\infty$ to $x$ to get a function that starts at $0$ and at $a$ climbs smoothly to a value and levels off at $b$. It can then be scaled and otherwise massaged to look like the characteristic function of a compact interval to any degree of accuracy. So I assumed that $g_n\in C^\infty_c$ is $0$ for $y<-1/n$, rises rapidly to a height $H_n$ by the time $y=-1/(n+1)$, stays level at $H_n$ until $y=1/(n+1)$ and then falls rapidly to $0$ by $y=1/n$, where it remains. The constant $H_n$ may be chosen so that $$\int_{-\infty}^\infty g_n(y)\,dy=1,$$ but initially, I will set it to $(n+1)/2$, in which case the above integral exceeds unity. We would then have that \begin{equation} \begin{split} |(g_n*f)(x)-f(x)|& =|(((g_n-G_{n+1})+G_{n+1})*f)(x)-f(x)|\\ &\leq|((g_n-G_{n+1})*f)(x)|+|(G_{n+1}*f)(x)-f(x)|. \end{split} \end{equation} We already know that the last term on the right tends to zero as $n\to\infty$, so it would remain to show that so does $((g_n-G_{n+1})*f)(x)$. $g_n$ has three pieces: a steep rise, a middle level part, and a steep fall. With the value I've chosen for $H_n$, the middle part is exactly cancelled out by $G_{n+1}$. The rising and falling parts of $g_n$ are symmetric, so it should suffice to show that the rising part $g_n^{(r)}$ of $g_n$ satisfies $(g_n^{(r)}*f)(x)\to 0$ as $n\to\infty$. I thought this would be easy and would depend on how fast $g_n$ rises. I need to estimate $$\int_{x-1/n}^{x-1/(n+1)}g_n(x-y)f(y)\,dy.$$ But it seems that I don't have enough information about $f$ away from $x$ to be able to do so. If I knew $f$ were bounded on $[x-1/n,x-1/(n+1)]$, for example, I would be done. But there is no reason to assume $f$ is so bounded. I do know that $f$ is the derivative of its indefinite integral, not only at $x$, but almost everywhere, by Rudin Real and Complex Analysis Theorem 7.11. Although I will need that to complete the exercise, I don't see how it helps me now.
My next attempt is to note that I can approximate $f$ in the $L^1$ norm by a function, call it $\phi\in C^\infty_c$. I can then show that the above integral (with $\phi$ in place of $f$) is small for large $n$, but then I am left with needing to show that $$\int_{x-1/n}^{x-1/(n+1)}g_n(x-y)(f(y)-\phi(y))\,dy$$ can be made small. But all I know is that $||f-\phi||_1$ can be made small. In this integral, the limits of the integration don't help me since I don't have a pointwise bound on $f$. If I try to use the $L^1$ bound, I find that I need to choose $\phi$ differently for each $n$. That would work for this integral, but it messes up the previous integral.
I've tried many other lines of attack with different types of Dirac sequences, but have not had any success. Can someone offer some suggestions?
EDIT
Thanks to Professor Ullrich's remarkably concise answer, my problem is solved. But for those, like me, who couldn't quite trust their own ability to jump from the given answer to the fully worked out problem, I include what I hope is a full solution using the main brilliant idea suggested by Professor Ullrich, namely to use the Fundamental Theorem of Calculus $$\phi(b)-\phi(a)=\int_a^b\phi'(t)\,dt$$ which creates an iterated integral and then to use the Fubini theorem to reverse the order of integration.
So, begin with the definitions \begin{equation*} \phi(t)=\frac{e^{-\frac{1}{1-t^2}}}{\int_{-1}^1e^{-\frac{1}{1-t^2}}\,dt}\chi_{[-1,1]}(t)\qquad\phi_n(t)=n\phi(nt)\quad(n=1,2,\dots). \end{equation*} Then each $\phi_n\in C^\infty_c$, is even, has support $[-1/n,1/n]$, and $\int\phi_n=1$. Define $F$, the indefinite integral of $f$, as before and assume that $x$ is such that $f(x)=F'(x)$. Next, we use the Fundamental Theorem of Calculus and Fubini (which I'll justify in a moment) and the fact that $\phi$ is even: \begin{equation*} \begin{split} (\phi_n*f)(x) &=\int_{-\infty}^\infty n\phi(n(y-x))f(y)\,dy\qquad\qquad\qquad\qquad(1)\\ &=n\int_{x-1/n}^{x+1/n}f(y)\int_{-1}^{n(y-x)}\phi'(t)\,dt\,dy\\ &=n\int\int\chi_{[x-1/n,x+1/n]}(y)\chi_{[-1,n(y-x)]}(t)f(y)\phi'(t)\,dt\,dy\\ &=n\int\int\chi_{[x-1/n,x+1/n]}(y)\chi_{[-1,n(y-x)]}(t)f(y)\phi'(t)\,dy\,dt\\ &=n\int_{-1}^1\phi'(t)\int_{x-1/n}^{x+1/n}\chi_{[-1,n(y-x)]}(t)f(y)\,dy\,dt\\ &=n\int_{-1}^1\phi'(t)\int_{x+t/n}^{x+1/n}f(y)\,dy\,dt\\ &=n\int_{-1}^1\phi'(t)(F(x+1/n)-F(x+t/n))\,dt\\ &=\int_{-1}^1\phi'(t)\Biggl[\frac{F(x+1/n)-F(x)}{1/n}+\frac{F(x)-F(x+t/n)}{1/n}\Biggr]\,dt. \end{split} \end{equation*} To justify the use of Fubini in going from the third to fourth line of (1), we first invoke the Rudin Real and Complex Analysis proof of Theorem 8.14, to get the necessary measurability. Next, we need to establish the finiteness of the iterated integral on the second line but with the absolute value of the integrand: \begin{equation} \begin{split} \int_{x-1/n}^{x+1/n}\int_{-1}^{n(y-x)}&n|f(y)|\:|\phi'(t)|\,dt\,dy\\ &\leq n||\phi'||_\infty\int_{x-1/n}^{x+1/n}\int_{-1}^1|f(y)|\,dt\,dy\\ &=2n||\phi'||_\infty\int_{x-1/n}^{x+1/n}|f(y)|\,dy\\ &=2n||\phi'||_\infty||\chi_{[x-1/n,x+1/n]}f||_1<\infty. \end{split} \end{equation} Next we compute the limit as $n\to\infty$ of the expression in square brackets (let's call it $E(t)$) on the last line of (1). \begin{equation*} \begin{split} \lim_{n\to\infty}E(t) &=\lim_{n\to\infty}\frac{F(x+1/n)-F(x)}{1/n} -t\lim_{n\to\infty}\frac{F(x+t/n)-F(x)}{t/n}\\ &=F'(x)-tF'(x)=F'(x)(1-t)=f(x)(1-t). \end{split} \end{equation*} So for all sufficiently large $n$, and for $-1\leq t\leq 1$, $$|E(t)|-|f(x)|(1-t)\leq|\:|E(t)|-|f(x)(1-t)|\:|\leq|E(t)-f(x)(1-t)|\leq 1,$$ hence $$|E(t)|\leq 2|f(x)|+1.$$ Therefore, for all sufficiently large $n$, the integrand at the end of (1) is bounded by $(2|f(x)|+1)|\phi'(t)|\in L^1$. Thus, by the Dominated Convergence Theorem, \begin{align*} \lim_{n\to\infty}(\phi_n*f)(x) &=\int_{-1}^1\phi'(t)f(x)(1-t)\,dt&&\\ &=f(x)\Biggl[\int_{-1}^1\phi'(t)\,dt-\int_{-1}^1t\phi'(t)\,dt\Biggr]&&\\ &=f(x)\Biggl[\phi(1)-\phi(-1)-\int_{-1}^1t\phi'(t)\,dt\Biggr]&&\text{(Fund. Thm of Calc)}\\ &=-f(x)\Biggl[t\phi(t)\biggl|_{-1}^1-\int_{-1}^1\phi(t)\,dt\Biggr]&& \text{(integration by parts)}\\ &=f(x)&&\text{since $\int\phi=1$.} \end{align*}
I don't quite follow what you're doing here. The result is easier than that:
Say $\phi\in C^\infty_c$ is even, non-negative, nonincreasing on $(0,\infty)$, and of course satisfies $\int \phi=1$. If $\phi_n(t)=n\phi(nt)$ then $\phi_n*f\to f$ at every point where $f=F'$.
Suppose just to simplify the notation that $f(0)=F'(0)=0=F(0)$. An integration by parts shows that $$\int f\phi=-\int F\phi'$$(you can easily prove that by Fubini), hence $$\int\phi_nf=\int\phi(t)f(t/n)=-n\int F(t/n)\phi'(t).$$Now $$\lim_n nF(t/n)=tF'(0)=0,$$so DCT shows that $$\int\phi_nf\to0,$$qed.