Independence of $(X,Y)$ with joint PDF $f_{X,Y}(x,y)=8xy$ on $ 0<y<x<1$

Take the case: $f_{X,Y}(x,y)=8xy, 0<y<x<1$.

Yet again an excellent example of the fact that densities should include restrictions on their domain.

Recall that any density of the couple of random variables $(X,Y)$ should be a function $f:\mathbb R\times\mathbb R\to\mathbb R_+$ such that what-you-know holds. In the present case, $f:\mathbb R\times\mathbb R\to\mathbb R_+$, $(x,y)\mapsto8xy$ is (obviously) not a density. Rather, a density of $(X,Y)$ is $f:\mathbb R\times\mathbb R\to\mathbb R_+$, $(x,y)\mapsto8xy\mathbf 1_{0<y<x<1}$ (for example $f(1,2)=0$, not $16$).

Now the result you mention is correct:

The random variables $X$ and $Y$ with density $f$ are independent if and only if there exist $g$ and $h$ such that $f(x,y)=g(x)h(y)$ for (almost) every $(x,y)$ in $\mathbb R\times\mathbb R$.

Which does not hold for the density $f$ in the example.

This remark is also useful when computing marginals. In general, $$ f_X(x)=\int_\mathbb Rf(x,y)\mathrm dy, $$ hence in the present case, $$ f_X(x)=\mathbf 1_{0<x<1}\int_\mathbb R8xy\mathbf 1_{0<y<x}\mathrm dy=x\mathbf 1_{0<x<1}\int_0^x8y\mathrm dy=4x^3\mathbf 1_{0<x<1}. $$ Note the absence of cases and the automaticity of the computations, thanks to adequate notations.

To sum up:

When a joint distribution is given by its PDF, a détour by the joint CDF is useless (and frankly often cumbersome) provided one uses the true PDF, which should include indicator functions if need be.