For a random variable $X$ with continuous c.d.f. $F$ on $\mathbb{R}$, show $F^{-1}(F(X))=X$ In my work I need to apply the following result and any hint on its proof will be greatly appreciated.
Proposition: Let $X$ be a real-valued random variable with continuous c.d.f. $F$. Define $V=F(X)$. Then $F^{-1}(V)=X$ almost surely, where
$$
F^{-1}(v) = \inf\{x:F(x)>v\}
$$
I am not one hundred percent sure about correctness of this proposition. To be specific, maybe we should define $F^{-1}$ as $F^{-1}(v) = \inf\{x:F(x) \geq v\}$. But I think I have at least seen one of the alternatives in some books, whose titles I couldn't recall.
Can anyone shed some light on this problem? Many thanks in advance!
 A: Note that
$$F^{-1}(F(x)) = \inf\{y:F(y)>F(x)\},$$
therefore, if $F^{-1}(F(x)) \neq x$, then by non-decreasingness of $F$ we have that $F^{-1}(F(x)) > x$. 
Claim: $F$ is flat on the interval $I = [x,F^{-1}(F(x))]$. 
Suppose that $x<y<F^{-1}(F(x))$, then by the second inequality $y$ fails to meet the requirement $F(y)>F(x)$, hence $F(y)\leq F(x)$ and by $x<y$ and the non-decreasingness of $F$, we have $F(x)\leq F(y)$. Therefore $F(x)=F(y)$ and $F$ is at least flat on the interior of $I$. The edge at $x$ is obvious to  have the $F$-value of $F(x)$ and for the right edge we define
$$y_n = F^{-1}(F(x))- \frac{x+F^{-1}(F(x))}{n}$$
then by continuity of $F$, as $y_n\to F^{-1}(F(x))$, 
$$F(x) = F(y_n)\to F(F^{-1}(F(x))).$$
Now we define a equivalence relation that $x\sim y$ iff $F^{-1}(F(x)) = F^{-1}(F(y))$. This can be shown to be valid, the resulting classes are either closed intervals or singletons and additionally one would still need to show that $F$ is flat on each class. After this, we note that for each $x\in\mathbb{R}$ such that $x<F^{-1}(F(x))$ that
$$\mathbb{P}(X\in\bar{x}) = F(F^{-1}(F(x))) - F(x) = 0.$$
Let $\mathcal{I}$ denote the set of all classes $I$ that are actual intervals (non-singletons / non-zero $\lambda$-measure). Then each interval $I$ in $\mathcal{I}$ contains at least one rational $q_I$ in $\mathbb{Q}$, therefore $\mathcal{I}$ is at most countable and since it can be shown that $I_1\cap I_2\neq \emptyset$ if $I_1\neq I_2$:
$$\mathbb{P}(F^{-1}(V) \neq X) = \mathbb{P}(F^{-1}(V) > X) = \mathbb{P}\left(\bigcup_{I\in\mathcal{I}}\{X\in\bar{q_I}\}\right)=\sum_{I\in\mathcal{I}} \mathbb{P}(X\in\bar{q_I}) = 0.$$
