Functions whose limit at infinity is zero are closed Let $F=\{f\in C(R):\lim_{|x|\to\infty}f(x)=0\}$, show $F$ is closed in $C(R)$.
First of all a little side question, why does the question specifically say that $F$ is closed in $C(R)$? Any limit point of $F$ will necessarily be a continuous function, right? This little thing makes me confused about definition of closedness in subspace, since $C(R)$ is a subset of all functions from $R$ to $R$. Is $F$ still closed in the space of all functions from $R$ to $R$?
My attempt:
Let $d$ be the supremum metric. Let $g\in\overline{F}$. Then $\exists \{f_n\}_{n\geq1}$ such that $f_n\to g$ uniformly.
Fix $\epsilon>0$. Then $\exists n_1\in N$ such that $\forall n\geq n_1, d(f_n,g)<\frac{\epsilon}{3}$.
Since $\{f_n\}_{n\geq1}$ Cauchy, $\exists n_2\in N, \forall n\geq n_2, d(f_n,f_{n_2})<\frac{\epsilon}{3}$.
$\exists t>0,\forall |x|\geq t,|f_{n_2}(x)|<\frac{\epsilon}{3}$
Then $\forall n\geq n_2,\forall|x|\geq t,|f_n(x)|\leq |f_{n_2}(x)|+|f_{n_2}(x)-f_n(x)|<\frac{2\epsilon}{3}$
Then $\forall n\geq \max\{n_1,n_2\},\forall|x|\geq t,|g(x)|\leq|f_n(x)|+|f_n(x)-g(x)|<\epsilon$.
Thus $\lim_{|x|\to\infty}g(x)=0$. Thus $g\in F$.
Am I correct?
 A: First, your side question: the question could easily have gotten away with not saying "in $C(\Bbb{R})$"; saying the set is closed would have implicitly meant inside the only metric space under consideration. But, sets are only "closed" or not with respect to topologies on the various spaces containing them. For example, $(0, 1]$ is closed in $(0, \infty)$, but not in $\Bbb{R}$, so if both spaces were under consideration, it'd be important to specify which.
As for your proof, it seems overly-complicated, but it appears correct. I do think it would benefit from a more direct approach. For example, it shouldn't be necessary to use Cauchiness and convergence. This is redundant; convergence should give you everything you need.
Following your basic outline,

Suppose $g = \lim_{n \to \infty} f_n$, where $f_n \in F$. Fix $\varepsilon > 0$. We wish to find $t$ such that
  $$|x| \ge t \implies |f(x)| < \varepsilon.$$
  Since $f_n \to g$, there exists some $n \in \Bbb{N}$ such that
  $$d(f_n, g) < \frac{\varepsilon}{2} \implies \forall x \in \Bbb{R}, \, |f_n(x) - g(x)| < \frac{\varepsilon}{2}.$$
  Since $f_n \in S$, there exists some $t$ such that
  $$|x| \ge t \implies |f_n(x)| < \frac{\varepsilon}{2}.$$
  Therefore,
  $$|x| \ge t \implies |g(x)| \le |g(x) - f_n(x)| + |f_n(x)| < \varepsilon,$$
  as required.

A: The most straightforward way to approach the problem seems to be to prove that a function $f \in C(\Bbb R)$ that's outside $F$ has a neighborhood that's also outside $F$.
If $f \notin F$, then $\exists y \gt 0 \ \text{such that} \ \forall  x \exists x_1 \gt x \ \text{with} \ \vert f(x_1) \vert \gt y$.  Thus, if $d(f, g) \lt y/2$, then $g \notin F$ (because $\forall  x \exists x_1 \gt x \ \text{with} \ \vert g(x_1) \vert \gt y/2$).  In other words, $B(f, y/2) \cap F = \emptyset$.  Since we chose an arbitrary $f \notin F$ and found a neighborhood outside $F$, the complement of $F$ is open so $F$ is closed.
