Let (\Omega, F, P) be a probability space, which may have atoms (important), S be a set of measurepreserving transformations T:\Omega\to\Omega, that is, such that preimage T^{1}(A) is measurable whenever A is measurable, and P(A)=P(T^{1}(A)). Then, obviously, random variables X and Y given by Y(\omega)=X(T(\omega)), T\in S, have the same distribution. I need the fact that the converse also true: if X and Y have the same distribution, then Y(\omega)=X(T(\omega)), for some T\in S. I am sure that this fact should be known, therefore do not want to reprove it. In the worst case, it should be a corollary from some known theorems, with 23 line proof. The question is: is it indeed known, and if so, where to refer?
It is not true, at least as stated here. For example, if $\Omega = [0,1]$ with Lebesgue measure, then $X(\omega)=\omega$ and $Y(\omega)=2\omega\text{ mod }1$ have the same distribution, and there exists a transformation that maps $X$ to $Y$, but it is not invertible, and there is no measurepreserving transformation from $Y$ to $X$. Indeed, if $X(\omega) = Y(T(\omega))$, then $T(\omega)$ should select either $\omega/2$ or $(\omega+1)/2$ in a measurepreserving way. $P[T^{1}([0,1/2])] = 1/2$, but note the "squeezing" map $\omega \mapsto \omega/2$ from $T^{1}([0,1/2])$ to $[0,1/2]$ obviously does not preserve Lebesgue measure. 

