Consider a uniform random variable $X$ on $(0,1)$ with density $p_X(x) = \mathbf{1}_{[0,1]}(x)$ and define $$ \{ 0, 1 \} \ni Y_X := \mbox{integer part of } 2 X \quad \mbox{and} \quad Z_X := X - Y_X. $$ distribution of $Y_X$ $$ \mathbb{P} (Y_X = 0) = \int_0^{\frac{1}{2}} p_X(x) d x = \frac{1}{2} \quad \mbox{and} \quad \mathbb{P} (Y_X = 1) = \int_{\frac{1}{2}}^1 p_X(x) d x = \frac{1}{2}. $$ The law of $Y_X$ is a Bernoulli of parameter $\frac{1}{2}$.
distribution of $Z_X$
Let $g(z)$ be a dummy fonction (continuous). \begin{align*} \mathbb{E} g(Z_X) & = \mathbb{E} g(Z_X) \mathbf{1}_{\{ Y_X = 0\} } + \mathbb{E} g(Z_X) \mathbf{1}_{\{ Y_X = 1 \} } \\ & = \mathbb{E} g(X) \mathbf{1}_{\{ 0 \leq X < \frac{1}{2} \} } + \mathbb{E} g(X-1) \mathbf{1}_{\{ \frac{1}{2} \leq X < 1 \} } \\ & = \int_0^{\frac{1}{2}} g(x) d x + \int_{\frac{1}{2}}^1 g(x-1) d x\\ & = \int_0^{\frac{1}{2}} g(x) d x + \int_{-\frac{1}{2}}^0 g(y) d y\\ & = \int_{-\frac{1}{2}}^{\frac{1}{2}} g(x) d x \end{align*} The law of $Z_X$ is uniform on $(-\frac{1}{2},\frac{1}{2})$.
question about independence between $Y_X$ and $Z_X$ ?
An authoritative professor told me that the two variables are independent,
BUT
for all dummy function $h(z,y)$, I got :
\begin{align*}
\mathbb{E} h(Z_X,Y_X) & = \mathbb{E} \left [ h(Z_X,0) | Y_X = 0 \right ] \mathbb{P} (Y_X = 0) + \mathbb{E} \left [ h(Z_X,1) | Y_X = 1 \right ] \mathbb{P} (Y_X = 1) \\
& = \int_0^{\frac{1}{2}} h(z,0) d z + \int_{-\frac{1}{2}}^0 h(z,1) d z.
\end{align*}
So, if $h$ is of the form $h(z,y) = \phi(z) \psi(y)$
$$
\mathbb{E} \phi(Z_X) \psi(Y_X) = \left ( \int_{-\frac{1}{2}}^0 \phi(z) d z \right ) \psi(0) + \left ( \int_0^{\frac{1}{2}} \phi(z) d z \right ) \psi(1)
$$
which is not
$$
\mathbb{E} \phi(Z_X) \mathbb{E} \psi(Y_X) = \int_{-\frac{1}{2}}^{\frac{1}{2}} \phi(z) d z \left ( \frac{1}{2} \psi(0) + \frac{1}{2} \psi(1) \right ) .
$$
Am I wrong to claim, standing up firmly on my feet, that the $Z_X$ and $Y_X$ are not independent?