How Find the $f(x)$ such $\lim_{x\to 1^{-}}\frac{\sum_{n=0}^{\infty}x^{n^2}}{f(x)}=1$ find the value $f(x)$ such

$$\lim_{x\to 1^{-}}\dfrac{\displaystyle\sum_{n=0}^{\infty}x^{n^2}}{f(x)}=1$$

This problem is china (2009College students' mathematical contest
  comption)  I have consider sometimes, and we know  we can't find this sum
$$\sum_{n=0}^{\infty}x^{n^2}$$
Thank you someone have nice methods

By the integral comparison test we have
$$
\int_0^\infty x^{t^2}\,dt \leq \sum_{n=0}^\infty x^{n^2} \leq 1 + \int_0^\infty x^{t^2}\,dt.
$$
Now
$$
\begin{align}
\int_0^\infty x^{t^2}\,dt &= \int_0^\infty \exp\left[-\left(t\sqrt{-\log x}\right)^2\right]\,dt \\
&= \frac{1}{\sqrt{-\log x}} \int_0^\infty e^{-u^2}\,du \\
&= \frac{1}{2} \sqrt{\frac{\pi}{-\log x}},
\end{align}
$$
so
$$
\lim_{x \to 1^-} 2 \sqrt{\frac{-\log x}{\pi}} \sum_{n=0}^\infty x^{n^2} = 1.
$$
To simplify this a little we could use the fact that
$$
\lim_{x\to 1} \frac{\log x}{x-1} = 1
$$
to get
$$
\lim_{x \to 1^-} 2 \sqrt{\frac{1-x}{\pi}} \sum_{n=0}^\infty x^{n^2} = 1.
$$
