Let $a_1,a_2,\ldots,a_n\geq 1$, and let $f:\mathbb{R}^+\rightarrow\mathbb{R}^+$. Consider the sum
$$S(f)=\sum_{i}f(a_i)-\sum_{i<j}f(a_i+a_j)+\sum_{i<j<k}f(a_i+a_j+a_k)-\cdots+(-1)^{n-1}f(a_1+\cdots+a_n).$$
This question shows that if $f(x)=\frac1x$, then $S(f)>0$ for all $a_1,\ldots,a_n$. If we perturb $f$ a tiny bit, say $f(x)=\frac{1}{x}-\frac{1}{100x^{100}}$, I would imagine that $S(f)>0$ still always holds. But the proof method for $f(x)=\frac1x$ is hard to generalize to other functions. Can we prove it in some other way?
More generally, is there a theorem out there stating sufficient conditions under which $S(f)>0$ always holds?