[proofplan]
Let $A$ be the upper level set on which $F$ is at least $p$, so that the generalized quantile is $\inf A$. The endpoint limits in the definition of a distribution function ensure that $A$ is nonempty and bounded below, hence the infimum is a real number. One implication follows immediately from the definition of the infimum. For the reverse implication, we use right-continuity of $F$ to prove that the infimum itself belongs to the upper level set, and then use monotonicity to compare $F(F^{-1}(p))$ with $F(x)$.
[/proofplan]
[step:Show that the upper level set has a finite infimum]
Define the set
\begin{align*}
A:=\{y\in\mathbb R:F(y)\ge p\}.
\end{align*}
Since $F$ is a distribution function, it is nondecreasing, right-continuous, and satisfies
\begin{align*}
\lim_{y\to-\infty}F(y)=0
\end{align*}
and
\begin{align*}
\lim_{y\to\infty}F(y)=1.
\end{align*}
Because $p<1$, the limit at $+\infty$ gives a point $y_+\in\mathbb R$ such that $F(y_+)>p$, so $y_+\in A$ and $A\neq\varnothing$. Because $p>0$, the limit at $-\infty$ gives a point $y_-\in\mathbb R$ such that $F(y)<p$ for every $y\le y_-$. Hence $A\subset (y_-,\infty)$, so $A$ is bounded below. Therefore
\begin{align*}
q:=\inf A
\end{align*}
is a real number, and by definition $q=F^{-1}(p)$.
[guided]
We isolate the set whose infimum defines the quantile:
\begin{align*}
A:=\{y\in\mathbb R:F(y)\ge p\}.
\end{align*}
The number $F^{-1}(p)$ is meaningful as a real number only after we check that this set is nonempty and bounded below.
First, $A$ is nonempty. Since $F$ is a distribution function,
\begin{align*}
\lim_{y\to\infty}F(y)=1.
\end{align*}
Because $p<1$, the difference $1-p$ is positive. By the definition of the limit at $+\infty$, there exists $y_+\in\mathbb R$ such that $F(y_+)>p$. Thus $y_+\in A$, so $A\neq\varnothing$.
Second, $A$ is bounded below. Since $F$ is a distribution function,
\begin{align*}
\lim_{y\to-\infty}F(y)=0.
\end{align*}
Because $p>0$, the definition of the limit at $-\infty$ gives a point $y_-\in\mathbb R$ such that $F(y)<p$ for every $y\le y_-$. Therefore no point $y\le y_-$ belongs to $A$, and hence
\begin{align*}
A\subset (y_-,\infty).
\end{align*}
So $A$ is bounded below. Since $A$ is also nonempty, its infimum exists in $\mathbb R$. We define
\begin{align*}
q:=\inf A.
\end{align*}
By the definition of the generalized quantile, this means $q=F^{-1}(p)$.
[/guided]
[/step]
[step:Use membership in the upper level set to prove $F^{-1}(p)\le x$]
Let $x\in\mathbb R$ and suppose that $p\le F(x)$. Then $x\in A$. Since $q=\inf A$ is a lower bound for $A$, every element of $A$ is at least $q$. In particular,
\begin{align*}
q\le x.
\end{align*}
Because $q=F^{-1}(p)$, this proves
\begin{align*}
F^{-1}(p)\le x.
\end{align*}
[/step]
[step:Use right-continuity to put the infimum in the upper level set]
We prove that $q\in A$. Let $\varepsilon>0$. Since $q+\varepsilon$ is strictly larger than $\inf A$, it cannot be a lower bound for $A$. Hence there exists $a_\varepsilon\in A$ such that
\begin{align*}
a_\varepsilon<q+\varepsilon.
\end{align*}
Since $q$ is a lower bound for $A$ and $a_\varepsilon\in A$, we also have $q\le a_\varepsilon$. Thus
\begin{align*}
q\le a_\varepsilon<q+\varepsilon.
\end{align*}
Let $\mathbb N=\{1,2,3,\dots\}$ denote the set of positive integers. Choose a sequence $(\varepsilon_n)_{n\in\mathbb N}$ in $(0,\infty)$ by
\begin{align*}
\varepsilon_n:=\frac{1}{n}.
\end{align*}
For each $n\in\mathbb N$, choose $a_n\in A$ such that
\begin{align*}
q\le a_n<q+\varepsilon_n.
\end{align*}
Then $a_n\to q$ and $a_n\ge q$ for every $n\in\mathbb N$. Right-continuity of $F$ at $q$ therefore gives
\begin{align*}
F(a_n)\to F(q).
\end{align*}
Since $a_n\in A$, we have $F(a_n)\ge p$ for every $n\in\mathbb N$. Since $F(a_n)\to F(q)$ in $\mathbb R$ and the interval $[p,\infty)$ is closed, the limit also belongs to $[p,\infty)$. Hence
\begin{align*}
F(q)\ge p.
\end{align*}
Therefore $q\in A$.
[guided]
The point of this step is to prove that the threshold is actually attained at the infimum. This is precisely where right-continuity is needed.
Let $\varepsilon>0$. Since $q=\inf A$, the number $q+\varepsilon$ lies strictly above the infimum. Therefore $q+\varepsilon$ cannot be a lower bound for $A$. If it were a lower bound, then every element of $A$ would be at least $q+\varepsilon$, contradicting the fact that $q$ is the greatest lower bound. Hence there exists $a_\varepsilon\in A$ such that
\begin{align*}
a_\varepsilon<q+\varepsilon.
\end{align*}
At the same time, $q$ is a lower bound for $A$, so $q\le a_\varepsilon$. Thus, for every $\varepsilon>0$, we can find a point of $A$ in the right-hand interval $[q,q+\varepsilon)$.
Let $\mathbb N=\{1,2,3,\dots\}$ denote the set of positive integers. Now define a sequence $(\varepsilon_n)_{n\in\mathbb N}$ by
\begin{align*}
\varepsilon_n:=\frac{1}{n}.
\end{align*}
For each $n\in\mathbb N$, choose $a_n\in A$ with
\begin{align*}
q\le a_n<q+\varepsilon_n.
\end{align*}
The squeeze inequalities show that $a_n\to q$ and that the approach is from the right, because $a_n\ge q$ for all $n\in\mathbb N$.
Since $F$ is a distribution function, it is right-continuous at $q$. Applying right-continuity to the sequence $(a_n)_{n\in\mathbb N}$ gives
\begin{align*}
F(a_n)\to F(q).
\end{align*}
Because each $a_n$ belongs to $A$, the definition of $A$ gives
\begin{align*}
F(a_n)\ge p
\end{align*}
for every $n\in\mathbb N$. This means every term $F(a_n)$ lies in the closed interval $[p,\infty)\subset\mathbb R$. Since $F(a_n)\to F(q)$ and closed subsets of $\mathbb R$ contain limits of convergent sequences from the subset, we obtain
\begin{align*}
F(q)\ge p.
\end{align*}
Thus $q\in A$. This is the mechanism that would fail for a merely nondecreasing function without right-continuity.
[/guided]
[/step]
[step:Use monotonicity to prove the reverse implication]
Let $x\in\mathbb R$ and suppose that $F^{-1}(p)\le x$. Since $q=F^{-1}(p)$, this says $q\le x$. From the previous step, $F(q)\ge p$. Since $F$ is nondecreasing and $q\le x$, we have
\begin{align*}
F(q)\le F(x).
\end{align*}
Combining the inequalities gives
\begin{align*}
p\le F(x).
\end{align*}
Together with the first implication, this proves that for every $x\in\mathbb R$,
\begin{align*}
F^{-1}(p)\le x \quad \Longleftrightarrow \quad p\le F(x).
\end{align*}
[/step]
[step:Derive the strict inequality below the quantile]
Let $x\in\mathbb R$ and suppose that $x<F^{-1}(p)$. If $F(x)\ge p$, then the equivalence just proved would imply
\begin{align*}
F^{-1}(p)\le x,
\end{align*}
contradicting $x<F^{-1}(p)$. Therefore $F(x)<p$. This proves the final assertion.
[/step]