This question is related to this other one, but this other question does not give the answer to this one.
Find all function $f\colon \mathbb R\to \mathbb R\in C^\infty(]0,+\infty[)$ such that $f'=0$ has at most one zero, and $$\int_0^1 f(x)\mathrm d x=\sum_{n\geqslant 1} f(n).$$
We can prove that $f(x)=\frac 1{x^x}$ will work:
$f'(x)=-x^{-x}(1+\log x)$ has only one zero;
using $$x^x=e^{x\log x}=\sum_{n\in \mathbb{N}} \frac{(x\log x)^n}{n!}$$
and an inversion $\sum-\int$ (and the value of $\int_0^1 (x\log x)^n\mathrm d x$);
we can show that $$\int_0^1 \frac 1{x^x}\mathrm d x=\sum_{n\geqslant 1} \frac 1{n^n}.$$
Is there any other function $f$ satisfying those conditions?