Define $I = \begin{cases} 1,& \text{if } X\leq a\\ 0,& \text{if } X\gt a \end{cases}$
$X$ is uniform on $[0,1]$. We want to compute $Cov(I,X)$ which involves $E[IX]$.
$E[IX] = E[IX|I=1]P(I=1)+E[IX|I=0]P(I=0)=E[X]P(I=1)=E[X]P(X\leq a)=E[X]E[I]$
Hence, $Cov(I,X) = 0$.
This is wrong since they are not independent but I'm not sure where is the mistake.
Is it that $E[IX|I=1] \neq E[X] = \frac{1}{2}$, instead $E[IX|I=1] = \frac{a}{2}$?