Integration cannot be replaced by discrete sum Let $\{x_i\}_{i=1}^\infty$ be a dense subset of $[0,1]$ .
Let $(c_n)_n$ be a sequence in $\mathbb{R}$ such that $\sum_{n=1}^\infty c_n= 1$

Question: Is it possible to have
$$\int_0^1 f(x)dx= \sum\limits_{i=1}^\infty f(x_i)c_i\ , \ \forall f\in C([0,1]) \quad ?$$

Clearly not, but how to prove it?
 A: I assume that the $c_i$'s are non-negative, so $\mu := \sum_{i \ge 1}c_i\delta_{x_i}$ is a probability measure on $[0,1]$. Call $\lambda$ the Lebesgue measure on $[0,1]$.
If we had for every $f \in \mathcal{C}(0,1)$,
$$\int f\mathrm{d}\lambda = \int f\mathrm{d}\mu,$$ it would imply that $\lambda=\mu$. Indeed, by the monotone convergence theorem, the equality would be true for every indicator function of an open set (such a function can be written as a non-decreasing limit of continuous non-negative functions).
Since open sets are closed under finite intersections and generate the Borel $\sigma$-field, it would imply that $\lambda=\mu$, which is false.
A: We assume WLOG that $c_1 \neq 0$. Take $f(x)$ to be a triangular bump centered at $x_1$ with some width $w$ to be chosen later and height $1$. Then $\int_0^1 f(x) \, dx = \frac{w}{2}$. On the other hand, we can choose $w = w_n$ to be so small that the interval $[x_1 - w_n, x_1 + w_n]$ does not contain $x_2, x_3, \dots x_n$, which gives that
$$\sum_{i=1}^{\infty} c_i f(x_i) = c_1 + \sum_{i=n+1}^{\infty} c_i f(x_i)$$
where $\left| \sum_{i=n+1}^{\infty} c_i f(x_i) \right| \le \sum_{i=n+1}^{\infty} |c_i|$. So as $n \to \infty$ the LHS $\int_0^1 f(x) \, dx = \frac{w_n}{2}$ gets arbitrarily small while the RHS gets arbitrarily close to $c_1$, and so they cannot be equal.
This is just a straightforward formalization of the intuitive idea that the RHS overweights the values of $f$ at the $x_i$ for which $c_i$ is large.
Edit: Ah, there's a small gap, the argument that the RHS gets arbitrarily close to $c_1$ requires that $\sum c_i$ converges absolutely. I assume the intent was in fact to have $c_i \ge 0$ so I don't mind assuming this. And I guess if $\sum c_i$ doesn't converge absolutely then we can find a sequence of functions $f$ such that the LHS stays bounded but the RHS goes to $\infty$.
A: Assume that the $c_i$ are positive.
Take a continuous version $f_n$ of $\chi_{[x_{i_0}-\frac{1}{n},x_{i_0}+\frac{1}{n}]}$ for a fixed $i_0\in \mathbb N$, then:
$$c_{i_0}=c_{i_0}f_n(x_{i_0})\le \sum_{i\in \mathbb N}  c_{i}f_n(x_{i})=\int_0^1 f_n(x)\text dx\stackrel{n\to \infty}{\longrightarrow}0.$$
So, by the generality of $i_0$, you get that $c_i=0 \;\forall i\in \mathbb N$
and this creates a contradiction.
