Solution (source code)

= Solution

Let $U$ be uniformly distributed on $X$ and let $\eta$ be the law of $(U,U)$. Both marginals are $\mu$, because
$$
\eta(X\times A)=\mathbb P(U\in A)=\eta(A\times X).
$$
However, $\eta$ is concentrated on the diagonal $\{(x,x):x\in X\}$, which has two-dimensional Lebesgue measure zero. Thus $\eta$ is not Lebesgue measure on $X^2$.