If $$F(x)=P[X \leq x]$$ is continuous in $x$, show that $Y=F(X)$ is measurable and that $Y$ has a uniform distribution $$P[Y\leq y]=y, 0 \leq y \leq 1$$
Proof so far: To show that $Y$ has a uniform distribution , for any $y \in [0,1]$ we have:
$$ P[Y \le y] = P[F(X) \le y] = P[X \le F^{-1}(y)] = F(F^{-1}(y)) = y.$$
Since $F$ is a nondecreasing function, the preimage of every set of the form $(a, \infty)$ has the form $[b, \infty)$ or $(b, \infty)$. This shows that $F$ is a Borel-measurable function, which in turn shows that $F(Y)$ is measurable.
Your proof only works if $F$ is actually injective, but in general this is not the case. You need to use the generalized inverse $F^{-1}(x) = \inf \{x \mid F(x) \ge y\}$.