I found two theorems in my notes and they seem to be somewhat complementary which made me doubt that both of them are true:
a) Let $X,Y: \Omega \rightarrow \mathbb{R}$ be a measurable function and if $im(X)$ and $im(Y)$ are countable, then it is sufficient to check for independence whether $P(\{X=c\} \cap \{Y=d\}) = P(\{X=c\}) P(\{Y=d\})$ for all $(c,d) \in im(X) \times im(Y)$ holds.
b) Let $X,Y: \Omega \rightarrow \mathbb{R}$, where $(\Omega, \mathscr{E},P)$ is a discrete prob. space, then $P(\{X=c\} \cap \{Y=d\}) = P(\{X=c\}) P(\{Y=d\})$ for all $(c,d) \in im(X) \times im(Y)$ holds.
So in the first case we demand that the image is discrete and in the second case we want that the prob. space itself is discrete. Are both of them true, cause it could also be a spelling mistake in my notes?
If anything about this question is unclear, please let me know and if you know that one of them is true/false, this is also helpful!
The statement $(a)$ is true. $X,Y$ are independent r.v if, and only if, the events $ \{ X \le a \} $ and $ \{ Y \le b \} $ are independent sets.
Once the images are countable you can write
$$ \{ X \le a \} = \bigcup_{d \le a}\{X=d\} $$
$$ \{ Y \le b \} = \bigcup_{c \le b}\{Y=c\} $$
Now, note that union is a disjoint union. So,
$$ P(\bigcup_{c \le a}\{Y=c\}, X =d) = P( \bigcup_{c \le a}(\{Y=c\} \cap \{ X =d \})) $$
using that the union is disjoint and the hypothesis you get that $ \{X = d\}$ and $\{ Y \le b \}$ are independent. Repeat the same argument now to $\bigcup_{d \le a}\{X=d\} \cap \{ Y\le b\}$ and using what you have above you get the result.