TITLE: How to analyze $\sup_{x>0}|e^xf(x)| < \infty$ and $\sup_{n\in\mathbb{N}} |f^{(n)}(0)|< \infty$?
QUESTION [17 upvotes]: 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.)

REPLY [6 votes]: There is a proof using the following Phragmén-Lindelöf principle on a sector of the complex plane.
Theorem: Consider a closed sector $S=\{z\in {\mathbb C}^*\mid \alpha\leq\arg(z)\leq\beta\}\cup\{0\}$ of angular opening $\beta-\alpha<\pi$.
Consider $f:S\to\mathbb C$ continuous on $S$, holomorphic in its interior.
Suppose that $f$ is bounded by 1 on the boundary of $S$ and that there exists a constant $C$ such that $|f(z)|\leq C\exp(C|z|)$ for $z\in S$.
Then $|f(z)|\leq1$ for $z\in S$.
To show that this theorem is not a mysterious black box, I add a (classical) proof using the maximum modulus principle at the end of the answer. Actually, this proof could be incorporated in the answer to make it only use the maximum modulus principle, but I prefer to refer to the Phragmén-Lindelöf principle.
Answer to the question: Let $M>1$ denote a bound for $|a_n|$, $n\in\mathbb N$ and for $|e^xf(x)|$, $x\geq0$. Then it is readily shown that
$$|f(x)|\leq M e^{|x|}\mbox{ for }x\in\mathbb C.$$
Consider now the sector $S=S(\alpha)$ of the upper half plane bounded by the rays 
$\arg x=0$ and $\arg x=\pi-\alpha$ with some small positive $\alpha$. Consider
on $S$ the function
$$g(x)=\frac1M\exp(q(\alpha)ix)\, e^xf(x)$$
with a real positive $q(\alpha)$ to be determined. Clearly its modulus can be bounded by some expression  $\exp(C|x|)$ on $S$ if $C$ is sufficiently large. On the ray $\arg x=0$, we find that $|g(x)|\leq 1$ by the choice of $M$. On the ray
$\arg x=\alpha$, we find
$$|g(x)|\leq e^{|x|}\exp\left(\mbox{Re}\,x\right)\exp\left(-q(\alpha)\mbox{Im}\,x\right)\leq\exp(|x|(1-\cos\alpha-q(\alpha)\sin\alpha)).$$
If we choose $q(\alpha)=(1-\cos(\alpha))/\sin(\alpha)$, then we can conclude that
$|g(x)|\leq1$ also on the ray $\arg x=\pi-\alpha$.
Now the Phragmén-Lindelöf principle applies on $S$ and yields that $|g(x)|\leq1$
on $S$. This means that
$$|e^xf(x)|\leq M\exp(q(\alpha)\mbox{Im}\,x)\mbox{ for }x\in S(\alpha).$$
Let us now fix some $x$ in the upper half plane ($\mbox{Im}\,x>0$). For any sufficiently small positive $\alpha$, the sector $S(\alpha)$ contains $x$ and the above inequality holds. Observe that $M$ is independent of $\alpha$.
Now as $\alpha$ tends to 0, $q(\alpha)=(1-\cos\alpha)/\sin\alpha$ also does.
Hence we obtain that $|e^xf(x)|\leq M$ for $x$ in the upper half plane.
For $x$ on the real axis we also have $|e^xf(x)|\leq M$: For non-negative $x$ by assumption and choice of $M$, for negative $x$ because of $|f(x)|\leq Me^{|x|}$.
For $x$ in the lower half plane, we can conclude in exactly the same way, that
$|e^xf(x)|\leq M$.
Therefore $e^xf(x)$ is a bounded entire function and, by Liouville's theorem, it is a constant. Since the value at $x=0$ is 1 by assumption, we find that
$e^xf(x)=1$ and hence $f(x)=e^{-x}$. The uniqueness of the Taylor series yields $a_n=(-1)^n$.
Proof of the Theorem: Using a rotation in $\mathbb C$, we can assume that $\alpha=-\beta$. We choose $r>1$ such that $2r\beta<\pi$. For arbitrary $B>0$, we consider the function $g_B(z)=f(z)\exp\left(-B\,z^r\right)$ on $S$. Since $\mbox{Re }(z^r)\geq \gamma|z|^r$ with $\gamma=\cos(r\beta)>0$ on $S$, we find
$$|g_B(z)|\leq C\exp\left(C|z|-B\gamma\,|z|^r\right)\mbox{ on }S.$$
Therefore, if $R$ is sufficiently large, we have $|g_B(z)|\leq1$ for $z\in S$ with $|z|=R$.
Now $|g_B(z)|\leq1$ for $z$ on the boundary of $S_B=\{z\in S\mid|z|\leq R\}$. As $g_B$ is holomorphic in the interior of $S_B$, the maximum modulus principle applies and yields that $|g_B(z)|\leq1$ on $S_B$. Since $R$ can be chosen arbitrarily large, this is valid on the whole sector $S$. Thus we have proved for arbitrary $B>0$ that $|f(z)|\leq |\exp\left(B\,z^r\right)|$ on $S$.
Fixing $z$ and letting $B$ tend to 0, we obtain that $|f(z)|\leq 1 $ as desired.