I ask a similar question to my previous one (which I do not know why has been removed).
Let $X$ be an Hilbert space obtained through the closure of $C_c^{\infty}(\mathbb R, \mathbb R^n)$ with respect to a norm defined as $$\|f\|= \int_{\mathbb R} f(x)^T M(x) f(x) dx,$$where $M(x)$ is a symmetric and positive definite matrix with continuous entries.
Let $f\in X$. I would like to show that both $f^+:=\max\{f(x), 0\}$ and $f^-:=\max\{-f(x), 0\}$ still belong to $X$.
Since $f\in X$, one has that there exists $\{f_n\}_n\subset C_c^{\infty}(\mathbb R, \mathbb R^n)$ such that $\|f_n-f\|\to 0$ as $n\to +\infty$.
How to use this information to get the result e.g. for $f^+$? Is there any relation between $\{f_n\}_n$ and the sequence that one has to take to get the result e.g. for $f^+$?
EDIT: $f(x)\in\mathbb R^n$. Here $f^\pm$ means the positive/negative part over each component.