Step 1: Check option (A).
If
\[
P(\{n\})=\frac{1}{n+1},
\]
then by countable additivity,
\[
P(S)=\sum_{n=1}^{\infty}P(\{n\})
\]
\[
=\sum_{n=1}^{\infty}\frac{1}{n+1}
\]
This series diverges.
So,
\[
P(S)\neq 1
\]
Hence, option (A) is false.
Step 2: Check option (B).
Let \(A\) be the set of even positive integers and \(B\) be the set of odd positive integers.
Both \(A\) and \(B\) are infinite sets.
So, according to the given rule,
\[
P(A)=1
\]
and
\[
P(B)=1
\]
But \(A\cap B=\emptyset\) and
\[
A\cup B=S
\]
Thus, by additivity,
\[
P(S)=P(A)+P(B)=1+1=2
\]
This is impossible because
\[
P(S)=1
\]
Hence, option (B) is false.
Step 3: Check option (C).
Given
\[
P(\{1,2,\ldots,n\})=\int_{1}^{n}\frac{1}{x}\,dx
\]
Now,
\[
\int_{1}^{n}\frac{1}{x}\,dx=\log n
\]
For sufficiently large \(n\),
\[
\log n>1
\]
But probability of any event cannot exceed \(1\).
Hence, option (C) is false.
Step 4: Check option (D).
Given
\[
P(\{1,2,\ldots,n\})=\int_{0}^{n}e^{-x}\,dx
\]
Now,
\[
\int_{0}^{n}e^{-x}\,dx=1-e^{-n}
\]
This lies between \(0\) and \(1\) for every \(n\geq 1\), and
\[
\lim_{n\to\infty}(1-e^{-n})=1
\]
So, we can define probabilities of singletons by
\[
P(\{1\})=1-e^{-1}
\]
and for \(n\geq 2\),
\[
P(\{n\})=(1-e^{-n})-(1-e^{-(n-1)})
\]
\[
=e^{-(n-1)}-e^{-n}
\]
These probabilities are non-negative and their total sum is \(1\).
Therefore, such a probability function exists.
Hence, option (D) is true.
Step 5: Final conclusion.
The only true statement is
\[
\boxed{(D)}
\]