Approximating a Singular Measure with a Riemann sum Consider the usual formula Riemann integral, which one learns in Calculus:
$\lambda(f)=\lim_P \sum_{X\in P} f(x_X)\lambda(X)$ 
Here $\lambda$ denotes Lebesgue measure on $[0,1]^n$, $P$ is a partition of $[0,1]^n$, and $x_X$ is an arbitrarily chosen point in $X$. The limit is taken over a sequence of increasingly finer partitions. The function $f$ is continuous. 
Does this formula hold verbatim if $\lambda$ is replaced by an arbitrary bounded Borel measure? If not, can it be salvaged by imposing additional hypotheses? 
 A: Yes, it holds verbatim (again for a continuous function $f$ on $[0,1]^n$, or more generally on a compact metric space).
For partition $P$ of $[0,1]^n$, define
$\overline{f}_P$ and $\underline{f}_P$ so that for $x \in X \in P$,
$\overline{f}_P(x) = \sup_{y \in X} f(y)$ and  $\underline{f}_P(x) = \inf_{y \in X} f(y)$.  In particular, $\underline{f}_P \le f \le \overline{f}_P$.
For an arbitrary bounded Borel measure $\mu$ on $[0,1]^n$, we have
$\int \underline{f}_P \; d\mu \le \int f \; d\mu \le \int \overline{f}_P \; d\mu$.  Moreover, $\int \underline{f}_P\; d\mu \le \sum_{X \in P} f(x_X)\; \mu(X) \le \int \overline{f}_P\; d\mu$. 
If $f$ is continuous on $[0,1]^n$, it is uniformly continuous there, so for any $\epsilon > 0$, if $P$ is a sufficiently fine partition (so that all 
its members have diameter less than some $\delta > 0$) we have $\overline{f}_P - \underline{f}_P < \epsilon$, and thus $$\left| \int f \; d\mu - \sum_{X \in P} f(x_X)\; \mu(X) \right| \le \int \overline{f}_P \; d\mu - \int \underline{f}_P\; d\mu \le \epsilon \|\mu\|$$
