Suppose that $$f(x)=1+\sum_{n=1}^\infty a_n \frac{x^n}{n!}\ \ \forall \ x\in \mathbb{R}$$ where $\sup_{x>0}\left|e^xf(x)\right| < \infty$ and $\sup_{n\in\mathbb{N}} |a_n|< \infty$.
Prove that $a_n = (-1)^n$ , $\forall n\in \mathbb{N}$
It seems amazing to me. What we need to prove is $f(x)=e^{-x}$. It seems insufficient to prove this strong conclusion, but actually it is true and all the "counterexamples" I found were wrong.
My attempt
Put $g(x)=e^x f(x)$. $$\left|g^{(n)}(0)\right|=\left|\sum_{k=0}^n \binom{n}{k} f^{(k)}(0)\right|\le 2^n\sup_{n\in\mathbb{N}} |a_n| $$ Put $h(x)=g(\frac{x}{2})$. Thus $$h^{(n)}(0)=\frac{1}{2^n}g(0) \le \sup_{n\in\mathbb{N}} |a_n|$$ which implies that $$h(x)=1+\sum_{n=1}^\infty b_n \frac{x^n}{n!}\ \ \forall \ x\in \mathbb{R}$$ where $$|b_n|\le \sup_{n\in\mathbb{N}} |a_n| \ \ \forall \ n\in\mathbb{N} \,\,\,\,\,\& \,\,\,\,\, \sup_{x>0}\left|h(x)\right| < \infty $$
And hence if $b_k<0$, then there exists $l>k$ such that $b_l>0$. I want to yield a contradiction by supposing this, but I failed.
Any hints or other new ideas? Thanks in advance!
(I heard that this problem can be solved by complex analysis. This is the reason why I attach the complex-analysis tag.)
Let us prove the following:
Proof. Consider the sets \begin{equation*} S_1:=\{z\in\mathbb C\colon\Re z>-1\} \quad\text{and}\quad S_2:=\{z\in\mathbb C\colon|z|>1\}. \end{equation*} Define functions $g_1\colon S_1\to\mathbb C$ and $g_2\colon S_2\to\mathbb C$ by the formulas \begin{equation*} g_1(z):=(z+1)\int_0^\infty e^{-zt}f(t)dt \end{equation*} for $z\in S_1$ and \begin{equation*} g_2(z):=(z+1)\sum_{n=0}^\infty a_n/z^{n+1} \end{equation*} for $z\in S_2$. These functions are well defined and analytic, since $f(x)=O(e^{-x})$ as $\mathbb R\ni x\to\infty$ and the $a_n$'s are bounded. Moreover, because $\int_0^\infty e^{-zx}x^ndx=n!/z^{n+1}$ for all $z\in S_0:=\{w\in\mathbb C\colon\Re w>1\}\subset S_1\cap S_2$, one has $g_1=g_2$ on $S_0$. So, $g_1$ and $g_2$ are the restrictions to $S_1$ and $S_2$ of an analytic function $g\colon S\to\mathbb C$, where $S:=S_1\cup S_2=\mathbb C\setminus\{-1\}$. Moreover, $g(u)=g_1(u)=(u+1)\int_0^\infty e^{-ut}f(t)dt=O((u+1)\int_0^\infty e^{-ut-t}dt)=O(1)$ for real $u>-1$ and $|g(z)|=|g_2(z)|=O(|z|\sum_{n=0}^\infty 1/|z|^{n+1})=O(1)$ as $|z|\to\infty$.
We shall show that $-1$ is a pole of $g$. Hence, by considering (say) the Laurent series for the function $g$ at the point $-1$ and recalling that $g(u)=O(1)$ for real $u>-1$, we conclude that $g$ is a complex constant, say $C$. Thus, \begin{equation*} \sum_{n=0}^\infty a_n/z^{n+1}=\frac{g_2(z)}{z+1}=\frac C{z+1}=C\frac1{z(1+1/z)} =\sum_{n=0}^\infty C(-1)^n/z^{n+1} \end{equation*} for $z\in S_2$, and so, indeed $a_n = C (-1)^n$ for all $n=0,1,\dots$.
It remains to prove
Proof. Let $z$ be as in the statement of the lemma. Then $1/2\le|z|\le2$ and $x\le-1/2<0$, where
$x:=\Re z$ and $y:=\Im z$. Consider the following three possible cases.
Case 1: $x=\Re z\le-1$. Then $z\in S_2$, whence \begin{equation*} |g(z)|=|g_2(z)|\le \frac12\,K\sum_{n=0}^\infty 1/|z|^{n+1}\le\frac K{|z|-1}. \end{equation*} Moreover, here \begin{equation*} |z+1|^2=(|x|-1)^2+y^2\le|x|-1+y^2 \le (|x|-1)(|x|+1)+y^2=|z|^2-1\le3(|z|-1). \end{equation*} So, in Case 1 \begin{equation*} |g(z)|\le\frac{3K}{|z+1|^2}. \end{equation*}
Case 2: $|z|\le1$. Then $z\in S_1$, whence \begin{equation*} |g(z)|=|g_1(z)|\le \frac12\,K\int_0^\infty e^{-xt-t}dt\le\frac K{1+x}. \end{equation*} Moreover, here $y^2\le1-x^2\le2(1+x)$, whence \begin{equation*} |z+1|^2=(1+x)^2+y^2\le(1+x)^2+2(1+x)\le4(1+x). \end{equation*} So, in Case 2 \begin{equation*} |g(z)|\le\frac{4K}{|z+1|^2}. \end{equation*}
Case 3: $x=\Re z>-1$ and $|z|>1$. Then $z\in S_1\cap S_2$. Moreover, here
\begin{multline*} |z+1|^2=(1+x)^2+y^2=2(1+x)+x^2+y^2-1=2(1+x)+|z|^2-1 \\ \le 2(1+x)+3(|z|-1) \le[4(1+x)]\vee[6(|z|-1)]. \end{multline*} So, either (i) $|z+1|^2\le6(|z|-1)$ and then we bound $|g(z)|$ as in Case 1, getting here $|g(z)|\le\frac{6K}{|z+1|^2}$ or (ii) $|z+1|^2\le4(1+x)$ and then we bound $|g(z)|$ as in Case 2, getting here $|g(z)|\le\frac{4K}{|z+1|^2}$.
Thus, the proof of the lemma is complete.
Thus, the proof of the theorem is complete.
Remark. As the example of \begin{equation*} f(x)=\exp\{-(a+i\sqrt{1-a^2})x\}\quad\text{or}\quad f(x)= \Re\exp\{-(a+i\sqrt{1-a^2})x\} \end{equation*} for $a\in(0,1)$ shows, the condition $f(x)=O(e^{-x})$ in Theorem 1 cannot be relaxed to $f(x)=O(e^{-ax})$, for any real $a<1$.