For $u \in L^2([0,T])$ there exists $u_m \in C^\infty$ such that $u_m \to u$ in $L^2_{loc}(]0,T[)$. I am reading Navier-Stokes Equations by Roger Temam and there is a point in a proof I do not understand. Let me explain:
We have a function $u: [0,T] \to H \in L^2([0,T]; H)$, for $H$ some Hilbert space, and we define $\tilde{u}: \mathbb R \to H$ which is equal to $u$ on $[0,T]$ and $0$ otherwise. From there the author says that it is easy to obtain a sequence of functions $u_m \in C^\infty([0,T], H)$ such that $u_m \to u$ in $L^2_{loc}(]0,T[; H)$.
Here I have some questions. I am not totaly familiar with mollification for functions valued into a Banach space, but I think (?) it should be more or less the same as for real-valued function (so we can replace $H$ by $\mathbb R$). For a real-valued function, I know that for $\rho$ a mollifier and $\tilde{u}^\epsilon = \rho_\varepsilon * \tilde{u} \to \tilde{u}$ in $L^2(\mathbb R)$ for $\epsilon \to 0$ and $\text{supp }\tilde{u}^\epsilon \subseteq [-\varepsilon, T + \varepsilon].$ Therefore, it seems to me that $\tilde{u}^\epsilon\to \tilde{u}$ in $L^2([0,T])$. Why the author has $]0,T[$ instead of $[0,T]$ and from where comes this "$loc$" ?
 A: Setup. Let $Y$ be a Banach space. (In particular $H$ equipped with the norm induced by its inner product is a Banach space.) Let $I\subset\mathbb R$ be an open interval.
We define $C^\infty(I; Y)$, as is usually done, as the space of all functions $I\to Y$ that are continuous and such that all Fréchet derivatives of all orders exist. In this case, this is equivalent to (Gâteaux) derivatives of all orders existing and being continuous [Footnote 1].
Let $\phi\in L^1(\mathbb R)\cap L^\infty(\mathbb R)$ be a non-negative function satisfying $$\int_{\mathbb R} \phi(x)\,\mathrm dx=1$$ as well as $\operatorname{supp}\phi\subset[-1,1]$. [Footnote 2] For all $\varepsilon>0$, define $\phi_\varepsilon(x)=\frac 1\varepsilon\phi(x/\varepsilon)$ for all $x\in\mathbb R$. For any $p\in[1,\infty]$ and $u\in L^p(I; Y)$, define furthermore
$$u_\varepsilon(x)=\int_{I} \phi_\varepsilon(x-t) u(t)\,\mathrm dt.$$ (Exercise: Why is $u_\varepsilon$ well-defined for all $x\in\mathbb R$ and finite? Bonus exercise: Why is $u_\varepsilon\in L^p(\mathbb R;Y)\cap L^\infty(\mathbb R; Y)$ (hint: see Young's convolution inequality) ?)
Then we have the following result:
Theorem ([1; Theorem 8.20 and Theorem 8.21]). With the above setup, for all $p\in[1,\infty[$ and $u\in L^p(I; Y)$, we have $\lVert u_\varepsilon\rVert_{L^p(\mathbb R;Y)}\le\lVert u\rVert_{L^p(I; Y)}$,
$$\lim_{\varepsilon\downarrow 0} \lVert u_\varepsilon-u\rVert_{L^p(I;Y)} = 0,$$ as well as $$u_\varepsilon\in C^\infty(\mathbb R;Y).$$

About your questions:

*

*There is no difference between convergence in $L^2([0,T])$ and $L^2(]0,T[)$, since $\{0,T\}$ is a set of Lebesgue measure $0$.

*The $\text{loc}$ means the following: $L^2_{\text{loc}}(I; Y)$ denotes the space of all functions $u:I\to Y$ (modulo being equal almost everywhere in the Lebesgue sense) such that, for any compact $K\subset I$, we have $\lVert u\rVert_{L^2(K;Y)}<\infty$. We say that a sequence of functions $(u_m)_{m\in\mathbb N}$ in $L^2_{\text{loc}}(I; Y)$ converges to $u\in L^2_{\text{loc}}(I; Y)$ in the $L^2_{\text{loc}}(I; Y)$-sense if and only if $\lim_{m\to\infty} \lVert u-u_m\rVert_{L^2(K;Y)}=0$ for all compact $K\subset I$. In particular, $L^2$-convergence implies $L^2_{\text{loc}}$-convergence (why?). Therefore, Temam, as quoted by you, makes a correct statement ($L^2_{\text{loc}}$-convergence) that is actually substantially weaker than it could be ($L^2$-convergence).

Literature
[1] Giovanni Leoni, A First Course in Sobolev Spaces. Second Edition. Published by the American Mathematical Society, 2017.

[Footnote 1]: See for example https://math.stackexchange.com/a/3745076/631742 and https://math.stackexchange.com/a/3379185/631742.
[Footnote 2]: In other words, $\phi$ is a standard mollifier, see for example standard mollifier (comparing the definition in Evans and wiki).
