# Probability space defined by function from $X$ to $[0,1]$

Let $X$ be a non-empty countable set. If there is a function $f:X\rightarrow [0,1]$ such that $p(S)=\sum_{x\in S} f(x)$ for all $S \in 2^X$, then prove that $(X,2^X, p)$ is a probability space.

My partial answer: Let $\{A_n\}_{n\in \mathbb{N}}$ be a collection of disjoint subset of $X$. Let $A_n$={a_n^{(k)}: $k\in \mathbb{N}$}, then

$$p\left(\bigcup_{n=1}^{\infty} A_n\right) = \sum_{x\in \bigcup_{n=1}^{\infty} A_n} f(x)= \sum_{x\in \bigcup_{n=1}^{\infty} A_n} p(\{x\})=\sum_{n=1}^{\infty} \sum_{k=1}^{\infty} p(\{a_n^{(k)}\})= \sum_{n=1}^{\infty} p(A_n).$$ Hence, $p$ is $\sigma$-additive. However, I have no idea how to prove $p(X)=1$.

Thanks.

-

As stated, $p(X)=1$ doesn't follow (neither $p(X)<\infty$). Isn't there any assumption on $f$? (E.g. $\sum_{x\in X} f(x)=1$)

For a counterexample, let $X$ be infinite and $f(x)=1$ for all $x$.

-