I would like to prove the following fact:
Let $f:\mathbb{R}\rightarrow\mathbb{R}$ be a positive function and $\mu$ the counting measure $\mu(a)=\begin{cases} \vert A \vert & \mbox{if } A\mbox{ is finite} \\ \infty, & \mbox{if } A\mbox{ is not finite} \end{cases} $ then the following holds:
$f$ is integrable with respect to $\mu$ $\iff$ $A=\{ f(x), x\in\mathbb{R} \}$ is summable, i.e. $ \sum\limits_{a\in A}|a|$ is finite.
I would also like to know if the positivity of $f$ is necessary in both ways and ,if we can extend this result to a more general $f:X\rightarrow\mathbb{R}$, what properties does $X$ need to satisfy?
My attempt: I tried the $\Leftarrow$ proving that $A$ is at most countable and thus writing the sum of the absolute values as a series, but i'm stuck. I thought of using Beppo-Levi in some way.
Any help would be appreciated.
Summability of $\{f(a): a\in \mathbb R\}$ means that the finite sums $ \sum\limits_{k=1}^{n} |f(a_k)|$ where $\{a_1,a_2,...,a_n\}$ ranges over all finite subsets of $\mathbb R$ are bounded. And this is true if and only if there is a countable set $(a_n)$ of real numbers such that $f(a)=0$ when $a \in \mathbb R \setminus \{a_1,a_2,...\}$ and $\sum_n |f(a_n)| <\infty$. Let $A=\{a_1,a_2,...\}$ and $A_N=\{a_1,a_2,...,a_N\}$. If summability holds then $\int |f|d\mu =\int_A |f|d\mu=\lim_{N \to \infty} \int_{A_N} |f|d\mu$ (by Beppo-Levy theorem applied to the functions $f_n=|f|\chi_{A_n}$) $ =\lim_{N \to \infty}\sum\limits_{k=1}^{N} |f(a_k)|<\infty$ so $f$ is integrable.
Conversely if $f$ is integrable and $\{a_1,a_2,...,a_N\}$ is any finite subset of $\mathbb R$ then $\sum\limits_{k=1}^{N} |f(a_k)|\leq \int |f| d\mu $ which makes $\{f(a): a\in \mathbb R\}$ summable.