Let $S$ be a compact set of $\mathbb{R}$ such that:
- $m(S) >0.$
We can then consider the integral $$\int_S \frac{1}{t} dt.$$
My question is:
Under what conditions on $S$ is it true that this integral is either $\infty$ or $-\infty?$
It is not true for all compact sets $S$ of positive measure containing $0.$ For example, if $0$ is an isolated point of $S$ then the integral is not infinite. The condition seems to be something that $0$ should "carry enough measure", but I can not make sense of this. Any partial answers are welcome.
Added later: Another idea is to observe that
$$\frac{1}{t} = \int_t^\infty \frac{1}{x^2}\, dx.$$
Put that into the integral
$$\tag 1 \int_0^\infty \frac{\chi_S(t)}{t}\,dt$$
and use Fubini. That will give
$$\tag 2 \int_0^\infty \frac{m(S\cap(0,x))}{x^2}\,dx.$$
So $(1)=(2).$ That could be helpful. For example $(2)$ gives the result on positive density you were asking about.
Previous answer: To get you started, let $I_n$ be the interval $[4^{-n}/2, 4^{-n}], \,n=1,2,\dots$ Think about
$$S= \{0\} \cup I_1 \cup I_2 \cup \cdots$$