Suppose that $\mu$ is a Borel probability measure such that $\text{supp}(\mu) \subseteq \mathbb{R}^n$ is (locally) connected. Does there exist a continuous function $f:[0, 1]^n \to \mathbb{R}^n$ such that $f_\#(\theta)=\mu$? Here $\theta$ denotes the uniform distribution over $[0, 1]^n$ and $f_\#(\theta)$ is the pushforward measure of $\theta$ under $f$.
In the case where $n=1$ this is true by inverse transform sampling (we pick $f$ equal to the inverse cumulative distribution of $\mu$ which exists by connectedness of the support). In more dimensions this seems plausible but I haven't found a reference or been able to come up with a proof/counterexample.
Any hints or references are appreciated.
No, take the topologists sine-surve, that is, the set $S=\{\langle x,\sin\frac1x\rangle:0<x\le1\}\cup(\{0\}\times[-1,1])$. Now put a measure on this set by giving the vertical interval measure $\frac12$ (uniformly) and the graph of $\sin\frac1x$ too (uniform in $x$, say). A continuous function as desired would have to map the square onto $S$; but $S$ is connected but not locally connected, so not a continuous image of the unit square.