This fundamental fact follows directly from the definition of a cumulative density function (CDF), after applying some clever manipulation.
The definition of the CDF is the following
A function $F$ is called the CDF of a random variable $X$ when, for every number $z$, $P(X < z) = F(z)$.
Now, if we are in the above situation, we can ask
What is the CDF of the random variable $F(X)$?
Let's see
$$P(F(X) < z) = P(F^{-1}(F(X)) < F^{-1}(z)) = P(X < F^{-1}(z)) = F(F^{-1}(z)) = z $$
Here:
- In the first equality I have used that a CDF is always an increasing function. Otherwise there would be no (or a much more complex) relation between the two probabilities.
- In the second to last equality I have used the definition of a CDF, applied to the fact that $F$ is the CDF of the random variable $X$.
Reading from top to bottom:
$$P(F(X) < z) = z $$
Which, comparing with the definition of a CDF again, shows that the CDF of $F(X)$ is the identity function. The identity function is also the CDF of the uniform distribution. Distributions are the same if and only if their CDF is the same, so this also means that
$$ F(X) \sim U(0, 1) $$