To build on the example given above, the goal is to show that:
$f_{X,Y}(x,y) = k(x)g(y) \implies f_{X,Y}(x,y) = f_X(x)f_Y(y)$
Start with this equality:
$\int\int f(x,y) dydx= 1$
If $f$ factorizes cleanly into $k(x)$ and $g(y)$, we can write:
$\int \int k(x) g(y) dydx = 1$
$\int k(x)dx \int g(y) dy = 1$
Assuming $\int k(x)dx \neq 0$, we can write:
$\int g(y) dy = \frac{1}{\int k(x)dx }$
In order to get the PDF of $Y$ on the left hand side, multiply both sides by $k(x)$
$k(x) \int g(y) dy = \frac{k(x)}{\int k(x)dx }$
$f_Y(y) = \frac{k(x)}{\int k(x)dx }$
In order to get the PDF of $X$ on the right hand side, multiply by $1$ written sneakily as $\frac{g(y)}{g(y)}$
$f_Y(y) = \frac{k(x)g(y)}{g(y)\int k(x)dx }$
Notice that the numerator is the original joint distribution. So we can write:
$f_Y(y) = \frac{f(x,y)}{f_X(x) }$
And therefore
$f_Y(y)f_X(x) = f(x,y)$
$\square$