Making the hints given in the comments more explicit :
cut off $f$ and make a slow transition to $0$
The idea here is to multiply $f$ by a sequence $(u_n)_n$ of smooth compactly supported functions which "act like" $\left(\chi_{[-n,n]}\right)_n$, so that $(f\cdot u_n)_n$ and $\big((f\cdot u_n)'\big)_n$ converge in $L^2(\mathbb R)$ to $f$ and $f'$ respectively.
Such smooth functions are often called "cut-off functions" or "transition functions" and can be explicitly constructed to satisfy a set of desired properties. For instance, using a construction based on mollifiers similar to the ones given here or here, we can construct a sequence of functions $u_n \in C_c^\infty(\mathbb R)$ such that for all $n\ge 1$
$$\begin{cases}& u_n(x) \in [0,1],\ \forall x\in\mathbb R\\
&u_n(x) = 1,\ \forall x\in[-n,n]\\
&u_n(x) = 0,\ \forall x\in\mathbb R\setminus[-2n,2n]\\
&|u_n'(x)|\le 1, \forall x\in\mathbb R \end{cases} $$
Once you have shown (or admitted) that such functions exist, I let you check that the sequences $(f_n := f\cdot u_n)_n$ and $\left(f_n'\right)_n$ respectively converge to $f$ and $f'$ in $L^2(\mathbb R)$.
Now, because $f\in C^1$ and $u_n$ has compact support, it follows that their product $f_n$ is in $C_c^1(\mathbb R)$, and we are done.