Question
Suppose $E$ is a Banach space, and $F\subseteq E$ is a dense vector subspace. Suppose $f\in C^k([0,1],E)$, the space of $k$-times continuously differentiable $E$-valued functions, endowed with canonical norm $\lVert f\rVert_{C^k}=max_{0\le j\le k}\sup_{[0,1]}\lVert D^kf\rVert_E$. For each $\epsilon>0$, can we always find some $g\in C^k([0,1],E)$ such that $g([0,1])\subseteq F$ and $\lVert f-g\rVert<\epsilon$?
Background
It naturally comes from evolutionary PDEs. For example, we usually want to approximate non-homogeneous term. In this case, $E$ is some Sobolev space and $F$ is the space of Schwarz functions.
When $k=0$, it's true. By uniform continuity, we can choose a fine-enough partition of $[0,1]$ and approximate the value of each partition point with an element in $F$, then use the broken-line in $F$ to join these elements.
It seems hard for me to generalize the same idea to $k>0$. Any help is welcome.
The idea is to approximate the derivatives first. For $k=1$, you take $g_1\in C([0,1],F)$ such that $\|f'(t)-g_1(t)\|_E\le\epsilon$ for all $t$. With the construction you mention in the question, the resulting function has values only in a finite-dimensional subspace of $F$.
Then choose $g_0\in F$ such that $\|f(0)-g_0\|_E\le\epsilon$. Define $$ g(t) = g_0 + \int_0^t g_1(s)ds. $$ The integral is meant to be the Bochner integral, which can be used, as $g_1$ only takes values in a finite-dimensional space. (The anti-derivative of $g_1$ can also be explcitly calculated, as $g_1$ is piecewise linear in time).
Then $g\in C^1([0,1],F)$ and $$ \|f(t)-g(t)\|_E\le \|f(0)+g_0\|_E + \int_0^t \|f'(s)-g_1(s)\|_Eds \le 2\epsilon. $$