A sequence of pairwise uncorrelated random variables such that all pairs are not independent I am looking for a sequence of square integrable real random variables $(X_n)_{n\in\mathbb N}$ that are pairwise uncorrelated, i.e. $$\mathsf E(X_i) \mathsf E(X_j) = \mathsf E(X_i X_j)$$ for all $i\neq j$ BUT such that each pair $(X_i, X_j)$ is not independent.

My attempt: Start off with $X=\text{Uniform}([-1,1])$. I will try to write the $X_j$ in the form $X_j=f_j\circ X$ for some functions $f_j:[-1,1]\to\mathbb R$. These functions must satisfy $$\mathsf E(X_i X_j)=\int_{-1}^1f_i(x) f_j(x)\,\mathrm dx=\int_{-1}^1f_i(x)\,\mathrm dx\int_{-1}^1 f_j(x)\,\mathrm dx=\mathsf E(X_i) \mathsf E(X_j).$$
The functions $f_n(x)=\cos(2\pi n x)$ come to mind. Indeed, for this family of functions, both sides equal $0$, as can be checked easily by using $$\cos(2\pi i x)\cos(2\pi j x)=\frac{\cos (2 \pi  (i-j) x)+\cos (2 \pi  (i+j) x)}{2}.$$
Also, I think it can be proven from the definition of the $X_j$ that each pair $(X_i, X_j)$ is not independent (but I haven't done so yet).
Does my attempt work?
 A: Your construction looks OK to me.  The pair $(\cos \pi mt, \cos\pi nt)$
for $m\ne n$ gives rise to Lissajous-like curves which make the lack of independence clear.
Here is another example. Let $Z_n$ be iid $N(0,1)$ random variables, let $P(A=0)=P(A=1)=1/2$ be independent of the $Z_n$, and let $X_n=AZ_n$.  To check that the $X_n$ are not independent, evaluate $P(X_1>0)=P(X_2>0)=1/4$ and $P(X_1>0\text{ and }X_2>0)=1/8$.
A: Yes, the random variables given by me are indeed such that each $(X_i, X_j)$ is not independent. Let $\varepsilon>0$ and suppose that $X_i>1-\varepsilon$ for some $i\in\mathbb N$. This means that $\cos(2\pi i X)>1-\varepsilon$. Hence, by continuity of each function \begin{equation}(\cos|_{[2 n \pi,(2 n+1)\pi]})^{-1},\end{equation}
there exists a $\delta(\varepsilon)>0$ such that $2\pi i X\in]2\pi k-\delta(\varepsilon),2\pi k+\delta(\varepsilon)[$ for some $k\in\mathbb Z$ and such that $\lim_{\varepsilon\to0}\delta(\varepsilon)=0$.
This means that
\begin{equation}
X\in\bigcup_{k=-i}^i\left]\frac ki-\frac{\delta(\varepsilon)}i, \frac ki+\frac{\delta(\varepsilon)}i\right[\overset{\text{Def.}}=A.
\end{equation}
Each interval in the union has length $\frac{2\delta(\varepsilon)}i$ and there  are $2i$ intervals. Hence, since $\cos$ is $1$-Lipschitz, for any $j\in\mathbb N$,
$\cos(2\pi j A)$ has Lebesgue measure at most $4\delta(\varepsilon)$. If $\varepsilon$ is small enough, we have $4\delta(\varepsilon)<2=\text{length}([-1,1])$. Hence in that case, as $\mathsf P(X_j\in[a,b])>0$ for any $0\le a<b\le 1$, \begin{equation}\mathsf P(X_j\in[-1,1]\setminus\cos(2\pi j A)\mid X_i>1-\varepsilon)=0<\mathsf P(X_j\in[-1,1]\setminus\cos(2\pi j A))\end{equation} and thus $(X_i, X_j)$ is not independent.
