Is there any sequence of functions in $C_c (\mathbb R)$ which converges pointwise only to $e^{-x^2}$ This question has been posted earlier.  I could not understand the solution. Can anyone please help me to understand the solution?

let $C_c(\mathbb{R})$ = { f : $\mathbb{R} \rightarrow \mathbb{R}$ | f is continuous  and there  exist  a  compact  set $K$ such that  $f(x) = 0$ for all $x \in K ^c$} . let $g(x) = e^{-x^2}$  for all $x \in$ $\mathbb{R}.$

which of the  following satemnet is true?

1.There  exist a sequence {$f_n$} in $C_c(\mathbb{R})$ such that $f_n \rightarrow g$ uniformly

2.There exist a sequemce  {$f_n$} in $C_c (\mathbb{R})$ such that $f_n \rightarrow g$ pointwise 


If  a sequence in $C_c (\mathbb{R})$ converge pointwise to g then it must converge uniformly to $g$.


4.There doesnot  exists any sequence $C_c (\mathbb{R})$ converging pointwise to $g$

I can not understand the solution of 3. Can anyone please make me understand?


False. Start from $f_n$ but add a function $\psi_n\in C_c^{\infty}(\mathbb{R})$ with $\operatorname{supp}\psi_n\subset [n+1,n+2]$, and such that $\psi_n(\xi)=-1$ for some $\xi\in (n+1,n+2)$. Then $g_n:=f_n+\psi_n\in C_c^{\infty}(\mathbb{R})$ and $g_n(x)\to e^{-x^2}$ for all $x\in \mathbb{R}$, but $g_n$ does not converge uniformly to $e^{-x^2}$ because 
$$\sup_{x\in \mathbb{R}}|g_n(x)-e^{-x^2}|\geq |g_n(\xi)-e^{-\xi^2}|\geq 1  $$
The point is that you can take a sequence, even one that converges uniformly to $g$, and tweak it in such a way that it still converges pointwise, but not uniformly.
Consider first $g=0$. And take $g_n$ to be a &quot;traveling bump&quot;. For instance,
$$
g_n(t)=\begin{cases}
0,&amp;\ t\not\in[n,n+1]\\ \ \\
2t-2n,&amp;\ t\in [n,n+1/2]\\ \ \\
-2t+2n+2,&amp;\ t\in [n+1/2,n+1]
\end{cases}
$$
For any fix $t$, if $n&gt;t$ then $g_n(t)=0$. So $g_n\to0$ pointwise. But not uniformly, because $$g_n(n+1/2)-g(n+1/2)=1$$ for all $n$.
The solution you were given is basically to add the above example to a sequence $f_n$ converging to $e^{-x^2}$.
Quick answer: For Q.1 and Q.2, Yes. The following is a well known fact in general topology and functional analysis.

For any locally compact Hausdorff space $\Omega$, the set $C_c(\Omega)$ is a linear subspace of $C_0(\Omega)$. Moreover, $C_c(\Omega)$ is norm-dense in $C_0(\Omega)$ with respect to the supremum norm.

For your particular case, $\mathbb{R}$ is a locally compact Hausdorff topological space with respect to the usual topology and $x\mapsto \exp(-x^2)$ is an element in $C_0(\mathbb{R})$. The results follows immediately.