In Remark 18.13 of Real Analysis: Foundations and Functions of One Variable, the author states that
The class of Riemann integrable functions and the class of absolutely continuous functions are also dual: a function $f$ is Riemann integrable if and only if $\int_a^b{f\,dg}$ exists for every absolutely continuous function $g$, and a function $g$ is absolutely continuous if and only if $\int_a^b{f\,dg}$ exists for every Riemann integrable function $f$. The proof of this theorem, however, uses concepts from measure theory that we do not deal with in this book.
I am interested in finding a proof for these two statements. I have proved the following lemma:
Lemma. If $f$ is Riemann integrable on $[a,b]$ and $g$ is absolutely continuous on $[a,b]$, then the Riemann-Stieltjes integral $\int_a^b{f\,dg}$ exists with $$(\text{R-S})\int_a^b{f\,dg}=(\text{L})\int_a^b{f(x)g'(x)\,dx}.$$
The proof is not hard, but mostly relies on the fundamental theorem of calculus in Lebesgue integrals, so an elementary proof seems impossible. For future reader's reference, I added a sketch of the proof here.
Sketch of Proof. Since $g$ is absolutely continuous, it is differentiable a.e. on $[a,b]$. It is easy to see that $fg'$ is Lebesgue integrable on $[a,b]$. Let $(P,\xi)$ be a tagged partition of $[a,b]$. Consider the estimate \begin{align*} &\left|\sum_{i=1}^{n}{f(\xi_i)[g(x_i)-g(x_{i-1})]}-(\text{L})\int_a^b{f(t)g'(t)\,dt}\right| \\ \le~&\sum_{i=1}^{n}{(\text{L})\int_{x_{i-1}}^{x_i}{|f(\xi_i)-f(t)||g'(t)|\,dt}} \\ \le~&\omega\sum_{i=1}^{n}{(\text{L})\int_{x_{i-1}}^{x_i}{|g'(t)|\,dt}}=\omega\cdot(\text{L})\int_a^b{|g'(t)|\,dt}\le\omega V_a^b(g). \end{align*} Here $V_a^b(g)$ is the total variation of $g$ on $[a,b]$, while $\omega$ is the largest oscillations of $f$ on $[x_{i-1},x_i]$ for each $i=1,\ldots,n$. Since $f$ is Riemann integrable on $[a,b]$, we shall have $\omega\to 0$ as $P$ is refined. The desired assertion thus follows. $\square$
From this, the first statement is proved:
Proposition 1. $f$ is Riemann integrable on $[a,b]$ if and only if $\int_a^b{f\,dg}$ exists for every $g\in\operatorname{AC}[a,b]$.
Proof. ($\Longrightarrow$). This is precisely the lemma presented above.
($\Longleftarrow$). Note that the identity function $x\mapsto x$ is absolutely continuous, and the Riemann integral is a special case of the Riemann-Stieltjes integral with $g(x)=x$. $\square$
Proposition 2. $g$ is absolutely continuous on $[a,b]$ if and only if $\int_a^b{f\,dg}$ exists for every $f\in\mathcal{R}[a,b]$.
The direction ($\Longrightarrow$) is also trivial, as it is again the preceding lemma. However, I am stuck in the proof of the direction ($\Longleftarrow$), i.e., proving that $g\in\operatorname{AC}[a,b]$ whenever $\int_a^b{f\,dg}$ exists for every $f\in\mathcal{R}[a,b]$, as indicated in the title.
It is not hard to show that $g$ is (uniformly) continuous on $[a,b]$: For every $c\in[a,b]$, let $f:=\chi_{\{c\}}$. Then $f$ is clearly Riemann integrable on $[a,b]$ and discontinuous at $c$. By assumption, $\int_a^b{f\,dg}$ exists, so $g$ must be continuous at $c$ (see this post for the reason why).
It would be nice if I could hear from you guys about the proof for absolute continuity.
Update. Inspired from Oliver Díaz's comment, I realized that we had the following nice result:
Lemma 2. $g$ is of bounded variation on $[a,b]$ if $\int_a^b{f\,dg}$ exists for every continuous function $f$ on $[a,b]$.
Since $C[a,b]\subseteq\mathcal{R}[a,b]$, the function $g$ must be of bounded variation, i.e., $g\in\operatorname{BV}[a,b]$. The proof of Lemma 2 can be found from this post.
Update 2. Now that $g$ is continuous and has bounded variation on $[a,b]$. By Banach-Zaretsky Theorem, it suffices to show that $g$ has the following Luzin property (N), namely if $N\subseteq[a,b]$ with Lebesgue measure $\lambda(N)=0$, then $\lambda(g(N))=0$ as well. However, I still do not get how to prove this directly. Any help will be appreciated.