To define a measure, is it sufficient to define how to integrate continuous function?

In general this is false. Here are some examples to think about:

  1. If the $\sigma$-algebra on $X$ is not the Borel $\sigma$-algebra, there is generally no hope. (What if $X$ has the trivial topology but the $\sigma$-algebra is not trivial?) Hence you should restrict your attention to Borel measures.

  2. Take $X = \{a,b\}$ with the topology $\tau = \{\emptyset, \{a\}, \{a,b\}\}$. The Borel $\sigma$-algebra is $2^X$ but the only continuous functions $f : X \to \mathbb{R}$ are constant, so $\mu_1 = \delta_a$ and $\mu_2 = 2 \delta_a - \delta_b$ agree on all continuous functions. Thus you probably want a Hausdorff space.

  3. Take $X = \mathbb{R}$. Let $\mu$ be counting measure and $\nu = 2\mu$. So you probably want to look at $\sigma$-finite measures.

  4. As I mentioned in the above comment, on $X = \omega_1 + 1$ (which is compact Hausdorff), one can find two distinct finite measures which agree on all continuous functions.

However, here is a positive result.

Proposition. Let $\mu, \nu$ be finite Borel measures on a metric space $(X,d)$. If $\int f d\mu = \int f d\nu$ for all bounded continuous $f$, then $\mu = \nu$.

Proof. Let $E$ be a closed set, and let $f_n(x) = \max\{1 - n d(x,E), 0\}$. You can check that $f_n$ is continuous and $f_n \downarrow 1_E$ as $n \to \infty$. So by dominated convergence, $\mu(E) = \nu(E)$, and $\mu, \nu$ agree on all closed sets.

Now we apply Dynkin's $\pi$-$\lambda$ theorem. Let $\mathcal{P}$ be the collection of all closed sets; $\mathcal{P}$ is closed under finite intersections, and $\sigma(\mathcal{P})$ is the Borel $\sigma$-algebra $\mathcal{B}$. Let $\mathcal{L} = \{ A \in \mathcal{B} \colon \mu(A) = \nu(A)\}$. Using countable additivity, it is easy to check that $\mathcal{L}$ is a $\lambda$-system, and we just showed $\mathcal{P} \subset \mathcal{L}$. So by Dynkin's theorem, $\mathcal{B} = \sigma(\mathcal{P}) \subset \mathcal{L}$, which is to say that $\mu,\nu$ agree on all Borel sets, and hence are the same measure.


Check out the Riesz Representation Theorem, for example in $\textit{Real and Complex Analysis}$ by Rudin page 40. At least in the form presented in Rudin, if $X$ is a locally compact Hausdorff space and $\Lambda$ is a positive linear functional on $C_c(X)$, the continuous functions with compact support, then there exists a unique sigma algebra and a unique measure on the algebra such that $\int_X f \ d\mu = \Lambda(f)$ for all $f \in C_c(X)$.