# integral approximation (law of large numbers)

I am totally at a loss with this question and don't even know where to begin.

Let $g:[0, 1]\rightarrow \mathbb{R}$ be a measurable and Lebesgue-integrable function. $U_1, U_2, \dots$ be a series of independent and on $[0, 1]$ equally distributed random variables.
Let $X_i := g(U_i) \qquad \forall \, i=1, 2, \dots$

Question:
Is it possible to approximate $\int_0^1g(x)dx$ with $\sum_{i=1}^{n}\frac{X_i}{n}$.
And if that is possible, in which way and what can I say about the approximation error.

Edit:
Ok. I have an idea. Using Kolmogorov's strong law of large numbers which says

For equally distributed random variables $X_1, X_2, \dots \in L^1(\Omega, \mathcal{F}, \mathbb{P})$ is
$\frac{1}{n}\sum_{i=1}^{n}X_i \rightarrow \mathbb{E}X_1$ for $n\rightarrow \infty \, \mathbb{P}$ a.s.

I know that
$E[g(U_1)] = \int_{\mathbb{R}}g(x)f(x)d(x) = \int_{\mathbb{R}}g(x)1_{[0, 1]}d(x) = \int_{0}^1 g(x)d(x)$
and obviously
$\sum_{i=1}^{n}\frac{X_i}{n} = \frac{1}{n}\sum_{i=1}^{n}g(U_i)$

Now I only need to show that not only $U_i$ are random Variables but also $g(U_i)$. And how do I do that? Also, what about the approximation error?

Indeed, every function $g(U_i):\Omega\to\mathbb R$ is a random variable as the composition of the measurable functions $U_i:\Omega\to[0,1]$ and $g:[0,1]\to\mathbb R$. As you said, by the strong law of large numbers,
$$V_n=\frac1n\sum\limits_{i=1}^ng(U_i)$$ is an approximation of $\mu=E(g(U_1))$ when $n\to\infty$ in the sense that $V_n\to \mu$ almost surely when $n\to\infty$, and $$\mu=\displaystyle\int_0^1g(x)\mathrm dx.$$ The approximation error between $V_n$ and $\mu$ can be quantified in at least two (related) ways. First, for every $n$, $$E((V_n-\mu)^2)=\frac1n\sigma^2,\qquad\sigma^2=E((g(U_1)-\mu)^2).$$ Second, by the central limit theorem, when $n\to\infty$, $\sqrt{n}(V_n-\mu)$ converges in distribution to a centered normal distribution with variance $\sigma^2$. Both ways suggest a rate of convergence of order $1/\sqrt{n}$. Finally, $$\sigma^2=\int_0^1g^2(x)\mathrm dx-\mu^2=\int_0^1(g(x)-\mu)^2\mathrm dx.$$ These remarks are the basis of the approximate computation of integrals by Monte Carlo methods.