Assume that $f : \mathbb R \to \mathbb C$ is a $C^\infty$ function. Further assume that $g$ is continuous and of bounded variation.
Is it true that $$ \int_{\mathbb R} f(t)g(t) \, dt = \int_{\mathbb R} f'(t) \, dg(t) $$ where the left-hand side is a Riemann integral and the right-hand side is a Riemann-Stieltjes integral?
No, your equality is not true. We have only such equality $$ \int_{\mathbb R} f(t)g'(t) \, dt = \int_{\mathbb R} f(t) \, dg(t) $$ which is similar to yours and of course it is known from definition of Riemann-Stieltjes integral.