[Math] Show that the class $C_c(\mathbb{R^n})$ of continuous functions with compact support is not a complete metric space

complete-spacesmetric-spacesreal-analysissequence-of-functionsequences-and-series

I'm asked to show the following:

Show that the class $C_c(\mathbb{R^n})$ of continuous functions with compact support on $\mathbb{R^n}$ with the sup-norm metric $d(f,g):= \text{sup}_{x\in \mathbb{R^n}} |f(x) – g(x)|$is not a complete metric space. In other words, show that $C_c(\mathbb{R^n})$ is not closed within the class of bounded continuous functions on $\mathbb{R^n}$

I'm not really completely sure even how to approach this problem. To sort of get some intuition on this, I first tried working only with the class $C_c(\mathbb{R})$ of continuous functions with compact support on $\mathbb{R}$. So I need to construct a sequence $\{f_j\}$ of functions in $C_c(\mathbb{R})$ that converge to a function that's either unbounded, discontinuous or both.

I will define a function

$$f_j(x):= x^j \quad \text{if} \quad 0 \leq x < 1$$
$$\quad \quad \quad \quad \quad -x+2 \quad \text{if} \quad 1 \leq x \leq 2$$
$$0, \text{else}$$

Clearly this $f_j(x)$ will be $0$ for all $x \in \mathbb{R}\setminus[0,2]$, so $f_j$ has compact support. To be brief, I will just say that $f_j$ is bounded and continuous (this can easily be made rigorous). Now, consider the sequence of numbers $\{f_1(x), f_2(x), \ldots \}$. We see that this sequence converges to the function

$$f(x) = 0 \quad \text{if} \quad x<1 \quad \text{or} \quad x>2$$
$$-x+2 \quad \text{if} \quad 1 \leq x \leq 2$$

In particular, $f$ will be discontinuous at $x =1 $, so $f$ is not in the class of bounded continuous functions on $\mathbb{R}$. Thus, $C_c(\mathbb{R})$ is not a complete metric space.

Question 1: Is this even a correct way to show that $C_c(\mathbb{R})$ is not a complete metric space? I'm pretty new to these types of questions, so perhaps I'm not even quite sure what I need to show in my proof.

Question 2: If it is, is there any way to generalize this argument to show that $C_c(\mathbb{R^n})$ is not complete?

Best Answer

Let $f$ be any continuous function such that $f(x) \to 0$ as $|x| \to \infty$ but $f$ does not have compact support. Let $g$ be any continuous function such that $0\leq g \leq 1$, $g(x)=1$ for $|x| \leq 1$ and $0$ for $|x| >2$. Consider the sequence $g(\frac x n)f(x)$. This sequence converges uniformly to $f$. It is a Cauchy sequence in $C_c(\mathbb R^{n})$ but it is not convergent because its pointwise limit $f$ is not in this space.