Sequence in $C_c(\mathbb{R}^{d})$ i want to find a sequence $(f_i)_{i\in \mathbb{N}}$ in $C_c(\mathbb{R}^{d})$ such that $f_i = \chi[0,1]^d$ for $i \rightarrow \infty$ in the $L^1$-Norm.
Any ideas for such a sequence or how to construct it ?
So it should be a continuous function with compact support ?
 A: Expanding on the discussion in the comments:
Based on this answer, we let $f_i(x):=\max(0,1-i\operatorname{dist}(x,[0,1]^d))$, where $\operatorname{dist}(x,[0,1]^d)$ is the distance between $x\in \mathbb{R}^d$ and the set $[0,1]^d$ (you can verify that $f_i$ is continuous and has compact support). The idea behind choosing this sequence of functions is actually very intuitive: You fix all of the $f_i$'s to be $1$ on $[0,1]^d$ and you increase $i$ so that the region outside $[0,1]^d$ such that $f_i$ is nonzero shrinks to something arbitrarily small (think about the cases $d=1,2$ for simplicity). This works since $[0,1]^d\subset \mathbb{R}^d$ is closed.
Clearly, $f_i\to \chi_{[0,1]^d}$ pointwise as $i\to \infty$. Now you need to show that $f_i\to \chi_{[0,1]^d}$ in the $L^1$-norm. As noted by @Yanko in the comments, you can do this using the dominated convergence theorem. Let $g:=f_1$. Clearly one has that
$$|f_i(x)|\leq g(x)\, ,\quad \forall x\in \mathbb{R}^d,i\in \mathbb{N}\, ,$$
and $g$ is integrable (since it is bounded and nonzero only on a subset of finite measure). Hence $f_i\to \chi_{[0,1]^d}$ in the $L^1$-norm.
