TITLE: On an example of an eventually oscillating function
QUESTION [50 upvotes]: For $x\in(0,1)$, put
$$f(x):=\sum_{n=0}^{\infty}(-1)^{n}x^{2^{n}}.$$
This function possesses interesting properties. It grows monotonically from $0$ up to certain point. Then it starts to oscillate around the value $1/2$ on a left neighborhood of $1$, see Figure 1.

So there is at least a numerical evidence that $f(x)>1/2$ for some $x\in(0,1)$, for instance $f(0.995)\dot{=}0.500882$. Nevertheless, I did not find an analytic way to prove this observation.
Thus, I have two questions concerning the function $f$.
First, I would like to ask if there is an analytic proof (simple at best $\sim$ understandable for undergraduate students) that there exists $x\in(0,1)$ such that $f(x)>1/2$.
Second, since the limit of $f(x)$ as $x\to1-$ does not exists, I would like to know at least something about the value 
$$\limsup_{x\to1-}f(x).$$
Many thanks.

REPLY [6 votes]: A reference to this answer is Hardy's 'Divergent Series'. Although we do not obtain a magnitude of oscillation, the divergence of $\lim_{x\rightarrow 1-} f(x)$ follows from the following method. Here, we do not need numerical values, nor the Tauberian theorems, just a little bit of Complex Analysis.
After solving this problem, I realized that the same method applies here. 
Let $f(x)=\sum_{n=0}^{\infty} (-1)^n x^{2^n}$ as given. Let $g(x)=\sum_{n=0}^{\infty} \frac{(\log x)^n}{(2^n+1)n!}$. Then 
$$
f(x)+f(x^2)=x, \ \ g(x)+g(x^2)=x.
$$ 
Let $\Phi(x)=f(x)-g(x)$. Then we have
$$
\Phi(x)=-\Phi(x^2)=\Phi(x^4).
$$
If we prove that $\Phi$ is not a constant, then it follows that $\lim_{x\rightarrow 1-} f(x)$ does not exist. 
Taking the principal branch of logarithm, we see that $\Phi(z)=f(z)-g(z)$ is analytic on $D=\{z: |z|<1, \ \ z\notin (-1,0]\}$. 
Let $z=re^{2\pi i /3}$, and let $r\rightarrow 1-$. Then we have
$$
\Im(f(z))\rightarrow \infty, \textrm{ hence }|f(z)|\rightarrow\infty,
$$
$$
g(z) \textrm{ is bounded.}
$$
Thus, $\Phi(z)$ is not a constant on $D$. Hence, $\Phi(x), \ \ 0<x<1$ is not a constant. 
Added 3/29/2020
It can also be proved by this method that $\lim_{x\rightarrow 0+}g(x)$ does not exist.