Let $d\in\mathbb N$. Say that $(u_i)_{i\in\mathbb N}\subseteq[0,1)^d$ is uniformly distributed if $$\sup_{a\in[0,\:1)^d}\left|\frac1n\sum_{i=1}^n1_{[0,\:a)}(u_i)-\prod_{i=1}^da_i\right|\xrightarrow{n\to\infty}0\tag1.$$
How can we conclude that if $f:[0,1]^d\to\mathbb R$ is continuous, then $$\frac1n\sum_{i=1}^nf(u_i)\xrightarrow{n\to\infty}\int_{[0,\:1)^d}f\:{\rm d}\lambda^{\otimes d}\tag2,$$ where $\lambda$ denotes the Lebesgue measure on $\mathcal B(\mathbb R)?$
Noting that $\lambda^{\otimes d}\left([0,a)\right)=\prod_{i=1}^da_i$ for all $a\in[0,1)^d$ and $\mathcal B\left([0,1)^d\right)$ is generated by $\{[0,a):a\in[0,1)^d\}$, we easily see that $(2)$ is satisfied for all Borel measurable $f:[0,1)^d\to\mathbb R$ with $\left|f\left([0,1)^d\right)\right|\in\mathbb N$.
Now let $f_k:[0,1)^d\to\mathbb R$ be Borel measurable with $\left|f_k\left([0,1)^d\right)\right|\in\mathbb N$ and $\left|f_k\right|\le\left|f\right|$ for $k\in\mathbb N$ and $f_k\xrightarrow{k\to\infty}f$. By the aforementioned result, $(2)$ holds for $f$ replaced by $f_k$ for all $k\in\mathbb N$. By Lebesgue's dominated convergence theorem, $$\int_{[0,\:1)^d}\left|f_k-f\right|\:{\rm d}\lambda^{\otimes d}\xrightarrow{k\to\infty}0\tag3.$$
Now we can clearly write \begin{equation}\begin{split}&\left|\frac1n\sum_{i=1}^nf(u_i)-\int_{[0,\:1)^d}f\:{\rm d}\lambda^{\otimes d}\right|\\&\;\;\;\;\;\;\;\;\;\;\;\;\frac1n\sum_{i=1}^n\left|f_k-f\right|(u_i)+\left|\frac1n\sum_{i=1}^nf_k(u_i)-\int_{[0,\:1)^d}f_k\:{\rm d}\lambda^{\otimes d}\right|+\int_{[0,\:1)^d}\left|f_k-f\right|\:{\rm d}\lambda^{\otimes d}\end{split}\tag4\end{equation} for all $k,n\in\mathbb N$. But how can we conclude? We somehow need to use that $f$ is (uniformly) continuous on $[0,1)^d$, I guess.
By the way, are we able to relax any of the assumptions? For example, at least in the case of a finite image, $(2)$ even holds when $(1)$ is replaced by the weaker condition $$\left|\frac1n\sum_{i=1}^n1_{[0,\:a)}(u_i)-\prod_{i=1}^da_i\right|\xrightarrow{n\to\infty}0\;\;\;\text{for all }a\in[0,1)^d\tag{1'}.$$ But I'm not sure whether this can be extended for more general $f$. I would also like to know wheter we can impose a weaker condition than continuity on $f$.