Function $f:[0,1] \to [0,1]$ taking on each value in $[0,1]$ exactly twice

Let $x_\alpha$ be a well-ordering of $[0,1]$.

For any ordinal $\alpha = \theta + n < \frak{c}$ where $\theta$ is a limit ordinal or $0$ and $n$ is a finite ordinal, let $F(\theta + n \cdot 2) = F(\theta + n \cdot 2 + 1) = x_\alpha$.

Now define $f(x_\alpha) = F(\alpha)$ for all $\alpha \lt \frak{c}$ and it is clear that $f$ has the required property.