Let $(\Omega, \mathcal{F}, P)$ be a probability space and $X, Y:\Omega \to [0,1]$ be random variables. Prove that if
$$\mathbb{E}[f(X)]=\mathbb{E}[f(Y)] \text{ for all continuous }f:[0,1]\to\mathbb{R},$$
then $X$ and $Y$ have the same distribution.
My first idea was to prove that $P(X\leq \alpha)=P(Y\leq\alpha)$ for every $\alpha \in [0,1]$, which can be written as $\mathbb{E}[1_{\{X\leq\alpha\}}]=\mathbb{E}[1_{\{Y\leq\alpha\}}]$. Since $1_{\{X\leq\alpha\}}$ and $1_{\{Y\leq\alpha\}}$ may not be continuous, I thought about approximating them by continuous functions, but I'm having trouble to formalize this (not even sure it's possible).
Is there a better way? Thanks!