(Please let me know if this is more appropriate as a MathOverflow question.)
I can work out most of the following martingale generalization to the Riesz representation theorem and the Riemann–Stieltjes integral. But I also imagine it is a standard result, and I am looking for a reference.
The result:
Let $(X,\mathcal{B},P)$ be a Borel probability measure on a compact space $X$. Let $M_n$ be a (discrete time) $\mathcal{L}^1$-bounded martingale on a filtration $\mathcal{F_n}$ such that $\mathcal{F_n}\uparrow\mathcal{B}$ and $coarseness(\mathcal{F}_n)\rightarrow0$ where $coarseness(\mathcal{F}_n)\leq\delta$ iff there is a countable set $\{A_k\}\subseteq\mathcal{F}_n$ which covers $X$ such that $diameter(A_k)\leq \delta$ for all $k$. (Update: I didn't originally have this courseness/diameter stuff, but I think I need it. So I am also now assuming there is a metric on $X$. Also, the $\mathcal{F_n}\uparrow\mathcal{B}$ condition is now redundant.) Then for continuous functions $g$ on $X$, define the integral $\int g\ dM = \lim_n \mathbb{E}[g M_n]$. It is easy to check it is a bounded linear transformation on continuous functions, and hence an integral. (Update: The proof that it converges is at the end.)
Let $\nu$ be the corresponding signed measure. Then the limit of $M_n$ is the Radon–Nikodym derivative $d \nu /dP$. Also, $\nu$ is absolutely continuous if $M_n$ is uniformly integrable, $\nu$ is singular if $M_n$ converges to $0$ a.e., and $\nu$ is positive if $M_k$ is nonnegative. (Update: I originally wrote these as "if and only if"s but the situation is a bit more subtle, just like with bounded variation functions.)
Where can I find a reference for this?
I can see how this would not be a standard probability result since I am assuming something topological about the sample space.
Update: Proof that $\lim_n \mathbb{E}[g M_n]$ converges. Since the space is compact, $g$ is uniformly continuous. By the coarseness/diameter condition, there is some n' such that \Vert g - \mathbb{E}[g\mid \mathcal{F}_{n'}] \Vert_\infty \leq \epsilon for all n\geq n'. We show $\mathbb{E}[g M_n]$ is Cauchy. For n\geq n',
\left| \mathbb{E}[g M_n] - \mathbb{E}[g M_{n'}] \right| \leq \left\Vert (g - \mathbb{E}[g\mid \mathcal{F}_{n'}])(M_n - M_{n'})\right\Vert_1 + \left\Vert \mathbb{E}[g\mid \mathcal{F}_{n'}](M_n - M_{n'})\right\Vert_1
\leq \epsilon (\Vert M_n \Vert_1 + \Vert M_{n'} \Vert_1) + \left\Vert \mathbb{E}[g\mid \mathcal{F}_{n'}] \mathbb{E}[M_n - M_{n'}\mid \mathcal{F}_{n'}]\right\Vert_1
Since $M_n$ is a martingale, $\Vert M_{n} \Vert_1$ is bounded. Also, \mathbb{E}[M_n - M_{n'}\mid \mathcal{F}_{n'}]=0. Hence the righthand side of the inequality goes to $0$.