Preliminaries: Let $\mathrm{L}_P^2$ denote the Hilbert space of $P$-periodic, locally square-integrable functions $f\colon \mathbb{R} \to \mathbb{C}$ with Fourier series representation $$f(x) \sim \sum_{n \in \mathbb{Z}} \hat{f}_n \, \varphi_n (x),$$ where $$\hat{f}_n = \langle f, \varphi_n \rangle_{\mathrm{L}_P^2} = \int_0^P f(x) \overline{\varphi(x)} \, \mathrm{d}x$$ are the Fourier coefficients of $f$ with respect to the orthonormal basis functions $$\varphi_n(x) = \frac{1}{\sqrt{P}} \, \mathrm{e}^{2 \pi \mathrm{i} n x / P}.$$ Define also the periodic Sobolev space $$\mathrm{H}_P^1 = \left\{ f \in \mathrm{L}_P^2 : \|f \|_{\mathrm{H}_P^1}^2 = \sum_{n \in \mathbb{Z}} \left(1 + \frac{4 \pi^2 n^2}{P^2}\right) \big|\hat{f}_n\big|^2 < \infty \right\}.$$
Question: Given a radius $R > 0$ and a parameter $\mu > 0$, is the subset $$V = \left\{ f \in \mathrm{H}_P^1 : \|f \|_{\mathrm{H}_P^1} \leq R \quad \text{and} \quad\|f \|_{\mathrm{L}_P^2} = \mu \right\}$$ weakly closed?
Solution attempt 1: Observe that $V$ is the intersection of a closed ball, which is weakly closed, and the set $$U = \left\{ f \in \mathrm{H}_P^1 : \|f \|_{\mathrm{L}_P^2} = \mu \right\},$$ and so weak closedness of $V$ will follow provided the last set is weakly closed. However, the basis functions $\varphi_n$ converge weakly to $0$ in $\mathrm{H}_P^1$ by Bessel's inequality. Since $\|\varphi_n \|_{\mathrm{L}_P^2} = \mu$ (suitably scaled), the last $U$ cannot be weakly closed, and so our answer is no.
Solution attempt 2: Trying to establish that $U$ is weakly closed. Suppose $U \ni f_n \rightharpoonup f$ in $H_P^1$. Since $(L_P^2)^* \subset (H_P^1)^*$, it follows that $f_n \rightharpoonup f$ in $L_P^2$ also. Furthermore, by the Rellich–Kondrachov theorem, $H_P^1$ is compactly embedded in the space of $P$-periodic continuous functions $C_P$ with the uniform norm. Hence, as $\{f_n\}_n$ is weakly convergent and therefore bounded, there exists a subsequence $\{f_{n_k}\}_k$ that converges uniformly to some $g \in C_P$. Next, uniform convergence implies $L^2$-convergence in the periodic case, so $f_{n_k} \to g$ in $L_P^2$, and therefore $\|g \|_{L_P^2} = \mu$.
It remains to show that $f = g$. Any ideas?
The solution is based on Solution attempt 2:
Trying to establish that $U$ is weakly closed. Suppose $U \ni f_n \rightharpoonup f$ in $H_P^1$.
By the Rellich–Kondrachov theorem, $H_P^1$ is compactly embedded in the space of $P$-periodic continuous functions $C_P$ with the uniform norm. Hence, as $\{f_n\}_n$ is weakly convergent and therefore bounded, there exists a subsequence $\{f_{n_k}\}_k$ that converges uniformly to some $g \in C_P$. Next, uniform convergence implies $L^2$-convergence in the periodic case, so $f_{n_k} \to g$ in $L_P^2$, and therefore $\|g \|_{L_P^2} = \mu$.
It remains to show that $f = g$. Since $(L_P^2)^* \subset (H_P^1)^*$, it follows that $f_n \rightharpoonup f$ in $H_P^1$ implies $f_n \rightharpoonup f$ in $L_P^2$ also. Moreover, strong convergence implies weak convergence, and thus $f_{n_k} \rightharpoonup g$ in $L_P^2$. At last, subsequences of a weakly convergent sequence must converge to the same limit, and thus $f = g$.