Actually, this problem doesn't depend on knowing much about $f$. If $f$, $g$ are locally integrable on $\mathbb{R}$, and if
$$
\int f\varphi'\,dx = -\int g\varphi\,dx,\;\;\; \varphi\in C_{0}^{\infty}(\mathbb{R})
$$
then $f$ is equal a.e. to a continuous function $\tilde{f}$, and $\tilde{f}$ is absolutely continuous with $\tilde{f}'=g$ a.e..
To see this, choose $\varphi'$ to converge to $\frac{1}{\epsilon}\chi_{[a-\epsilon,a]}-\frac{1}{\delta}\chi_{[b,b+\delta]}$ for $0 < \epsilon,\delta$ and $a \le b$, and $\varphi$ to converge to the integral of this function (which has $0$ total integral.) Then you get
$$
\frac{1}{\epsilon}\int_{a-\epsilon}^{a}f\,dx-\frac{1}{\delta}\int_{b}^{b+\delta}f\,dx =-\int_{a-\epsilon}^{b+\delta}g\left[\int_{a-\epsilon}^{x}\frac{1}{\epsilon}\chi_{[a-\epsilon,a]}+\frac{1}{\delta}\chi_{[b,b+\delta]}\,dt\right]dx.
$$
The inner integral on the right converges to $\chi_{[a,b]}$ as $\epsilon\downarrow$ and $\delta\downarrow 0$, and it remains uniformly bounded by $1$ in the process. So the limit of the expression on the right exists as $\epsilon \downarrow 0$, $\delta\downarrow 0$, whether one at a time, or together. That means that the limits on the left also exist at every $a$, $b$. We know that the limits on the left are left- and right-hand derivatives of $\int_{0}^{x}f\,dt$, and by the Lebesgue differentiation theorem, those limits are equal a.e. to $f$. So, we have the a.e. equality
$$
f(a)-f(b) = -\int_{a}^{b}g\,dx.
$$
The function on the right is continuous in $a$, $b$, which means that $f$ is equal a.e. to a continuous function $\tilde{f}$, and $\tilde{f}$ is absolutely continuous with $\tilde{f}'=g$ a.e..
Mollifier: You are concerned that the weak relation
$$
\int_{\mathbb{R}}f'\varphi d\mu = -\int_{\mathbb{R}}f\varphi' d\mu,\;\; \varphi\in\mathcal{C}^{\infty}_{0}(\mathbb{R})
$$
cannot necessarily be strengthened to allow $\varphi$ to be a compactly supported absolutely continuous function instead. You can prove that such a thing can be done by finding $\eta \in \mathcal{C}^{\infty}_{0}(\mathbb{R})$ which is
- non-negative, non-vanishing and constant in a neighborhood of $x=0$,
- symmetric about $x=0$,
- supported in $[-1,1]$,
- bounded between $0$ and $\eta(0)$, and
- normalized so that $\int \eta d\mu =1$.
Then one defines
$$
\eta_{n}(x) = n\eta(nx)
$$
so that $\int_{\mathbb{R}}\eta_{n}\,d\mu =1$ for all $n$. For any compactly supported absolutely continuous function $\varphi$, define
$$
\varphi_{n} = \int_{\mathbb{R}}\eta_{n}(x-y)\varphi(y)\,d\mu(y).
$$
The function $\varphi_{n}$ is in $\mathcal{C}^{\infty}_{0}(\mathbb{R})$. Because $\eta_{n}$ is supported in $[-1/n,1/n]$, and $\varphi$ is continuous, then $\varphi_{n}$ converges uniformly to $\varphi$ as $n\rightarrow\infty$. And, because $\varphi$ is absolutely continuous, then
$$
\varphi_{n}' = \int_{\mathbb{R}}\eta_{n}'(x-y)\varphi(y)\,d\mu(y)=
-\int_{\mathbb{R}}\eta_{n}(x-y)\varphi'(y)\,d\mu(y).
$$
For my case $\varphi'$ is piecewise continuous, and the right side then converges pointwise everywhere to mean of the left- and right-hand limits of $\varphi'$, and it remains uniformly bounded by any bound for $\varphi'$. Thus, your weak equation
$$
\int f'\varphi_{n}d\mu = -\int f\varphi_{n}'d\mu
$$
becomes the following in the limit
$$
\int f'\varphi d\mu = -\int f \varphi' d\mu.
$$
For a general absolutely continuous $\varphi$, you can show that $\varphi_{n}$ converges uniformly to $\varphi$ and $\varphi_{n}'$ converges in $L^{1}(\mathbb{R})$ to $\varphi'$.
Mollifiers are very useful for extending integral equations for $\mathcal{C}^{\infty}_{0}$ functions to more general functions. If $\varphi$ has $k$ continuous derivatives that are compactly supported, then $\varphi_{n}$ and all $k$ derivatives converge uniformly to the corresponding derivatives of $\varphi$.