problem statement: Construct a continuous function $f(x)$ periodic with period $2\pi$ such that the Fourier series of $f(x)$ is divergent at $x = 0$ but the Fourier series of $f^2(x)$ is uniformly convergent on $[0, 2\pi]$.
Some context
The background of the problem. The following statement is a special case of the Wiener-Lévy theorem. If a positive function $f(x)$ is periodic by $2\pi$ and the Fourier series of $f^2(x)$ is absolutely convergent, then the Fourier series of $f(x)$ is also absolutely convergent. The following question arose: Can the absolute convergence be replaced by uniform convergence? The problem above states that it cannot be replaced without assuming the positivity. (R. Salem constructed an $f(x)$ whose Fourier series is uniformly convergent, but the Fourier series of $f^2(x)$ is not.) There are more ways to solve the problem. Lászó Lovász slightly modified Lipót Fejér's known construction: By adding the Fejér polynomials under a relatively strong gap condition, he received a continuous function $f(x)$ whose Fourier series is divergent at $x = 0$ and the Fourier series of $f^2(x)$ is uniformly convergent. It is also nontrivial to prove the uniform convergence of the Fourier series of $f^2(x)$. Lajos Pósa and Péter Gács solved the problem in an essentially similar way: They considered the function $f(x)$ instead of its Fourier series and used the observation that if the following inequality holds for a continuous, $2$-periodic function $g(x)$, then the Fourier series of $g(x)$ is uniformly convergent: $$|g(x) - g(y)| \leq \frac{1}{(\log(1/|x - y|))^{1+\epsilon}} $$ (See the Dini-Lipschitz condition in I. P. Natanson, Constructive Function Theory 1-3, 1964-65, VII. 3§.)
Now we prove the claim.
My little attempt
Denote by $s_{n}(f; x)$ the $n$th partial sum of the Fourier series of $f(x)$ where $f(x)$ is periodic by $2\pi$ and integrable, that is,
$$ s_{n}(f; x) = \frac{1}{\pi} \int_{0}^{\pi} f(2\vartheta) \frac{\sin((2n + 1) \vartheta)}{\sin \vartheta} d\vartheta \quad \text{from } 0 \text{ to } \pi $$
$$ f_{n}(x) = \sin\left(\frac{(2n + 1) x}{2}\right) \tag{0} $$
If, on $[0, 2\pi]$, $(1)$
$$ \text{then} $$
$$ s_{n}(f_{n}; 0) = \frac{1}{\pi} \int_{0}^{\pi} \frac{\sin^2 ((2n + 1) \vartheta)}{\sin \vartheta} d\vartheta $$ $$ > \frac{1}{\pi} \int_{0}^{\pi/2} \frac{\sin^2 ((2n + 1) \vartheta)}{\sin \vartheta} d\vartheta $$ $$ > \frac{1}{\pi} \int_{0}^{\pi/2} \frac{\sin^2 ((2n + 1) \vartheta)}{\vartheta} d\vartheta $$ $$ > \frac{1}{\pi} \int_{0}^{n\pi} \frac{\sin^2 \vartheta}{\vartheta} d\vartheta > A_{1} \log(n) $$
where $A_{1}$ and later $A_{2}$, $A_{3}$ are positive constants. Note that if $|g(x)| \leq 1$ is integrable, then for all $x$,
$$ |s_{n}(g; x)| \leq A_{2} \log(n) $$
The function we are going to construct will have the form $$F(x) = \sum_{\nu=1}^{\infty} c_{\nu} \sin\left(\frac{(2n_{\nu} + 1)}{2} x\right)$$
where $c_{\nu}$, $n_{\nu}$ are still undefined. Outside $[0, 2\pi]$ we will get the function by periodic continuation. The restriction
$$ |c_{\nu}| \leq 4^{-\nu} \quad (\nu = 1, 2, \ldots) $$ $\tag{5}$