[proofplan]
We transform the observations by $U_i=F_0(X_i)$ and first prove directly, using continuity of $F_0$, that the variables $U_1,\dots,U_n$ are i.i.d. uniform on $[0,1]$. The main point is then to compare the statistic on the $x$-scale with the statistic on the $t=F_0(x)$ scale. Because $F_0$ may have flat intervals, we use continuity and the absence of probability mass on flat levels to remove the only possible mismatch between ordering by $X_i$ and ordering by $F_0(X_i)$. This gives almost sure equality between the original statistic and the uniform empirical statistic built from $U_1,\dots,U_n$, hence equality in distribution with the stated statistic built from any i.i.d. uniform sample.
[/proofplan]
[step:Transform the sample through the null distribution function]
Let $(\Omega,\mathcal F,\mathbb P)$ denote the probability space on which $X_1,\dots,X_n$ are defined. For each $i\in\{1,\dots,n\}$, define the [random variable](/page/Random%20Variable) $U_i:(\Omega,\mathcal F)\to([0,1],\mathcal B([0,1]))$ by
\begin{align*}
U_i(\omega):=F_0(X_i(\omega)).
\end{align*}
Since each $X_i:(\Omega,\mathcal F)\to(\mathbb R,\mathcal B(\mathbb R))$ is measurable and $F_0:\mathbb R\to[0,1]$ is continuous, hence Borel measurable, each $U_i$ is measurable.
We prove that each $U_i$ has the $\operatorname{Unif}(0,1)$ distribution. Fix $i\in\{1,\dots,n\}$ and $t\in[0,1]$. Since $F_0$ is continuous, nondecreasing, and satisfies
\begin{align*}
\lim_{x\to-\infty}F_0(x)=0,
\end{align*}
and
\begin{align*}
\lim_{x\to\infty}F_0(x)=1,
\end{align*}
the level set
\begin{align*}
L_t:=\{x\in\mathbb R:F_0(x)=t\}
\end{align*}
is either empty or a closed interval, possibly unbounded at one end. For $0<t<1$, the intermediate value property gives $L_t\neq\varnothing$. Let
\begin{align*}
\ell_t:=\inf L_t,
\qquad
r_t:=\sup L_t
\end{align*}
in the extended real line. Then
\begin{align*}
\{F_0(X_i)\le t\}
=
\{X_i\le r_t\}
\end{align*}
up to the harmless convention that $\{X_i\le\infty\}=\Omega$ and $\{X_i\le-\infty\}=\varnothing$. Therefore
\begin{align*}
\mathbb P(U_i\le t)
=
\mathbb P(X_i\le r_t)
=
F_0(r_t)
=
t.
\end{align*}
For $t=1$, $0\le U_i\le1$ gives
\begin{align*}
\mathbb P(U_i\le1)=1.
\end{align*}
For $t=0$, fix $y\in\mathbb R$. The event $\{U_i\le0\}$ implies $X_i\le y$ whenever $F_0(y)>0$, and otherwise the bound $\mathbb P(U_i\le0)\le F_0(y)$ is still valid by monotonicity and nonnegativity of $F_0$. Hence
\begin{align*}
\mathbb P(U_i\le0)\le F_0(y)
\end{align*}
for every $y\in\mathbb R$. Letting $y\to-\infty$ and using $\lim_{y\to-\infty}F_0(y)=0$ gives
\begin{align*}
\mathbb P(U_i\le0)=0.
\end{align*}
Thus $U_i\sim\operatorname{Unif}(0,1)$.
Because $U_i=F_0\circ X_i$ is a measurable function of $X_i$, and $X_1,\dots,X_n$ are independent, the [preservation of independence](/theorems/1116) under coordinatewise measurable maps gives that $U_1,\dots,U_n$ are independent. Hence $U_1,\dots,U_n$ are i.i.d. $\operatorname{Unif}(0,1)$.
[/step]
[step:Define the uniform empirical distribution generated by the transformed sample]
Define the empirical distribution function $G_n:[0,1]\times\Omega\to[0,1]$ of the transformed sample by
\begin{align*}
G_n(t,\omega):=\frac{1}{n}\sum_{i=1}^n \mathbb{1}_{[0,t]}(U_i(\omega)).
\end{align*}
Let $V_i:(\Omega',\mathcal F',\mathbb P')\to([0,1],\mathcal B([0,1]))$, $i\in\{1,\dots,n\}$, be i.i.d. random variables with distribution $\operatorname{Unif}(0,1)$, and let $H_n:[0,1]\times\Omega'\to[0,1]$ be their empirical distribution function. By the previous step, the random vector $(U_1,\dots,U_n):\Omega\to[0,1]^n$ has the same distribution as $(V_1,\dots,V_n):\Omega'\to[0,1]^n$. Both empirical processes are obtained from the sample vector by the same deterministic measurable construction
\begin{align*}
(u_1,\dots,u_n)\mapsto \left(t\mapsto \frac{1}{n}\sum_{i=1}^n\mathbb{1}_{[0,t]}(u_i)\right),
\end{align*}
and the supremum functional is measurable because the resulting empirical distribution functions are step functions with jumps only at the finitely many sample values. Consequently, once we prove
\begin{align*}
\sup_{x\in\mathbb R}|F_n(x)-F_0(x)|
=
\sup_{0\le t\le1}|G_n(t)-t|
\end{align*}
almost surely, the desired equality in distribution follows.
[/step]
[step:Remove the null event where a sample point lies on a nontrivial flat level of $F_0$]
Let
\begin{align*}
\mathcal I:=\{(a,b)\subset\mathbb R:a<b,\ F_0 \text{ is constant on }(a,b)\}
\end{align*}
be the family of nonempty open intervals on which $F_0$ is constant. Every such interval contains a rational number, so the family of maximal open intervals on which $F_0$ is constant is countable. Enumerate those maximal intervals as $(I_m)_{m\in M}$, where $M\subset\mathbb N$.
For each $m\in M$, write $I_m=(a_m,b_m)$, where $a_m\in[-\infty,\infty)$ and $b_m\in(-\infty,\infty]$, and define the closed flat level set
\begin{align*}
J_m:=\{x\in\mathbb R:F_0(x)=c_m\},
\end{align*}
where $c_m\in[0,1]$ is the common value of $F_0$ on $I_m$. By continuity and monotonicity, $J_m$ is the closure of $I_m$ in $\mathbb R$ after deleting any infinite endpoint. More explicitly, with the endpoint conventions $F_0(-\infty):=0$ and $F_0(\infty):=1$, continuity gives $F_0(a_m)=c_m$ when $a_m$ is finite and $F_0(b_m)=c_m$ when $b_m$ is finite. Since $F_0$ is constant on $J_m$, for every $i\in\{1,\dots,n\}$ the probability of this closed flat level is
\begin{align*}
\mathbb P(X_i\in J_m)=F_0(b_m)-F_0(a_m)=c_m-c_m=0,
\end{align*}
with the same conclusion in the half-infinite endpoint cases by the displayed endpoint conventions.
Also, since each $U_i$ is $\operatorname{Unif}(0,1)$,
\begin{align*}
\mathbb P(U_i=0)=0
\end{align*}
and
\begin{align*}
\mathbb P(U_i=1)=0.
\end{align*}
Define the event
\begin{align*}
\Omega_0
:=
\bigcap_{i=1}^n\{0<U_i<1\}\cap\bigcap_{i=1}^n\bigcap_{m\in M}\{X_i\notin J_m\}.
\end{align*}
By finite and [countable subadditivity](/theorems/1108),
\begin{align*}
\mathbb P(\Omega_0)=1.
\end{align*}
[guided]
The technical issue is that $F_0$ need not be strictly increasing. If $F_0$ is flat on an interval, then the implication $F_0(X_i)\le F_0(x)\implies X_i\le x$ can fail when $X_i$ lies on the same flat level to the right of $x$. We remove this obstruction on a probability-one event.
Let
\begin{align*}
\mathcal I:=\{(a,b)\subset\mathbb R:a<b,\ F_0 \text{ is constant on }(a,b)\}.
\end{align*}
The maximal intervals in $\mathcal I$ are pairwise disjoint. Since every nonempty open interval in $\mathbb R$ contains a rational number and $\mathbb Q$ is countable, there are at most countably many maximal flat intervals. Enumerate them as $(I_m)_{m\in M}$, where $M\subset\mathbb N$.
Fix $m\in M$ and write $I_m=(a_m,b_m)$, allowing one endpoint to be infinite. Let $c_m\in[0,1]$ denote the common value of $F_0$ on $I_m$, and define
\begin{align*}
J_m:=\{x\in\mathbb R:F_0(x)=c_m\}.
\end{align*}
Continuity and monotonicity imply that $J_m$ is the real-line closure of $I_m$ with any infinite endpoint omitted. The distribution has no mass on this level set, and we compute this directly. Use the endpoint conventions $F_0(-\infty):=0$ and $F_0(\infty):=1$. If both endpoints are finite, then $J_m=[a_m,b_m]$ and continuity gives $F_0(a_m)=F_0(b_m)=c_m$, so for every $i\in\{1,\dots,n\}$,
\begin{align*}
\mathbb P(X_i\in J_m)=\mathbb P(a_m\le X_i\le b_m)=F_0(b_m)-F_0(a_m)=c_m-c_m=0.
\end{align*}
If one endpoint is infinite, the same computation uses the corresponding limit of $F_0$ at $-\infty$ or $\infty$, and again gives
\begin{align*}
\mathbb P(X_i\in J_m)=0.
\end{align*}
We also exclude the endpoint transformed values. Since $U_i\sim\operatorname{Unif}(0,1)$,
\begin{align*}
\mathbb P(U_i=0)=0
\end{align*}
and
\begin{align*}
\mathbb P(U_i=1)=0.
\end{align*}
Therefore the event
\begin{align*}
\Omega_0
:=
\bigcap_{i=1}^n\{0<U_i<1\}\cap\bigcap_{i=1}^n\bigcap_{m\in M}\{X_i\notin J_m\}
\end{align*}
has probability one. On $\Omega_0$, no sample point lies on a nontrivial flat level of $F_0$, including the endpoints of flat intervals. This is the precise condition needed in the next step: for every $x\in\mathbb R$ and every sample index $i$, the inequalities $X_i\le x$ and $F_0(X_i)\le F_0(x)$ become equivalent.
[/guided]
[/step]
[step:Compare the empirical counts on the original and transformed scales]
Fix $\omega\in\Omega_0$. For $x\in\mathbb R$, define $t_x:=F_0(x)$. We claim that, for every $i\in\{1,\dots,n\}$,
\begin{align*}
X_i(\omega)\le x \iff U_i(\omega)\le t_x.
\end{align*}
The forward implication follows from monotonicity of $F_0$. For the reverse implication, suppose $U_i(\omega)\le t_x$ and $X_i(\omega)>x$. Then monotonicity gives
\begin{align*}
F_0(x)\le F_0(X_i(\omega))=U_i(\omega)\le F_0(x),
\end{align*}
so $F_0$ is constant on the nonempty interval $(x,X_i(\omega))$. Hence $X_i(\omega)$ lies on the closure of a nontrivial flat level of $F_0$, contradicting $\omega\in\Omega_0$. Therefore the equivalence holds.
It follows that, for every $x\in\mathbb R$,
\begin{align*}
F_n(x,\omega)=G_n(F_0(x),\omega).
\end{align*}
Consequently,
\begin{align*}
\sup_{x\in\mathbb R}|F_n(x,\omega)-F_0(x)|\le \sup_{0\le t\le1}|G_n(t,\omega)-t|.
\end{align*}
Conversely, fix $t\in(0,1)$. Since $F_0$ is continuous and has limits $0$ and $1$ at $-\infty$ and $\infty$, the [intermediate value theorem](/theorems/180) gives a point $x_t\in\mathbb R$ with $F_0(x_t)=t$. Applying the preceding identity at $x_t$ gives
\begin{align*}
G_n(t,\omega)=F_n(x_t,\omega).
\end{align*}
Therefore
\begin{align*}
|G_n(t,\omega)-t|=|F_n(x_t,\omega)-F_0(x_t)|\le \sup_{x\in\mathbb R}|F_n(x,\omega)-F_0(x)|.
\end{align*}
At the endpoints, $G_n(0,\omega)=0$ and $G_n(1,\omega)=1$ because $0<U_i(\omega)<1$ for all $i$, so the endpoint values contribute $0$. Taking the supremum over $t\in[0,1]$ gives the reverse inequality. Hence
\begin{align*}
\sup_{x\in\mathbb R}|F_n(x,\omega)-F_0(x)|
=
\sup_{0\le t\le1}|G_n(t,\omega)-t|.
\end{align*}
Since $\mathbb P(\Omega_0)=1$, this equality holds almost surely.
[guided]
Fix $\omega\in\Omega_0$. The point of the event $\Omega_0$ is to make the original order and the transformed order agree exactly. For $x\in\mathbb R$, define $t_x:=F_0(x)$. We prove that each observation satisfies
\begin{align*}
X_i(\omega)\le x \iff U_i(\omega)\le t_x.
\end{align*}
If $X_i(\omega)\le x$, then monotonicity of $F_0$ gives $U_i(\omega)=F_0(X_i(\omega))\le F_0(x)=t_x$. Conversely, suppose $U_i(\omega)\le t_x$ but $X_i(\omega)>x$. Then
\begin{align*}
F_0(x)\le F_0(X_i(\omega))=U_i(\omega)\le F_0(x).
\end{align*}
All inequalities are equalities, so $F_0$ is constant on the interval between $x$ and $X_i(\omega)$. This puts $X_i(\omega)$ on the closure of a nontrivial flat level of $F_0$, which is excluded by the definition of $\Omega_0$. Therefore the reverse implication holds.
Counting the equivalent events gives, for every $x\in\mathbb R$,
\begin{align*}
F_n(x,\omega)=\frac{1}{n}\sum_{i=1}^n\mathbb{1}_{(-\infty,x]}(X_i(\omega))=\frac{1}{n}\sum_{i=1}^n\mathbb{1}_{[0,F_0(x)]}(U_i(\omega))=G_n(F_0(x),\omega).
\end{align*}
This identity gives one inequality immediately:
\begin{align*}
\sup_{x\in\mathbb R}|F_n(x,\omega)-F_0(x)|\le \sup_{0\le t\le1}|G_n(t,\omega)-t|.
\end{align*}
For the reverse inequality, take any $t\in(0,1)$. Continuity of $F_0$ and the limits $\lim_{x\to-\infty}F_0(x)=0$ and $\lim_{x\to\infty}F_0(x)=1$ allow the [intermediate value theorem](/theorems/629) to be applied on a sufficiently large finite interval; hence there is $x_t\in\mathbb R$ such that $F_0(x_t)=t$. The identity just proved gives
\begin{align*}
G_n(t,\omega)=G_n(F_0(x_t),\omega)=F_n(x_t,\omega),
\end{align*}
and therefore
\begin{align*}
|G_n(t,\omega)-t|=|F_n(x_t,\omega)-F_0(x_t)|\le \sup_{x\in\mathbb R}|F_n(x,\omega)-F_0(x)|.
\end{align*}
The only remaining transformed levels are $0$ and $1$. Because $\omega\in\Omega_0$, every transformed observation lies strictly between $0$ and $1$, so $G_n(0,\omega)=0$ and $G_n(1,\omega)=1$. Thus the endpoint values of $|G_n(t,\omega)-t|$ are both $0$. Taking the supremum over all $t\in[0,1]$ gives
\begin{align*}
\sup_{0\le t\le1}|G_n(t,\omega)-t|\le \sup_{x\in\mathbb R}|F_n(x,\omega)-F_0(x)|.
\end{align*}
Combining the two inequalities proves the desired equality of suprema on $\Omega_0$.
[/guided]
[/step]
[step:Conclude equality in distribution]
Define random variables $D_n:\Omega\to[0,1]$ and $K_n^U:\Omega\to[0,1]$ by
\begin{align*}
D_n(\omega):=\sup_{x\in\mathbb R}|F_n(x,\omega)-F_0(x)|
\end{align*}
and
\begin{align*}
K_n^U(\omega):=\sup_{0\le t\le1}|G_n(t,\omega)-t|.
\end{align*}
The previous step gives $D_n=K_n^U$ almost surely. Since $U_1,\dots,U_n$ are i.i.d. $\operatorname{Unif}(0,1)$, the process $G_n$ has the same distribution as $H_n$, and therefore
\begin{align*}
K_n^U
=
\sup_{0\le t\le1}|G_n(t)-t|
\end{align*}
has the same distribution as
\begin{align*}
K_n
=
\sup_{0\le t\le1}|H_n(t)-t|.
\end{align*}
Combining almost sure equality $D_n=K_n^U$ with equality in distribution of $K_n^U$ and $K_n$ proves that
\begin{align*}
\sup_{x\in\mathbb R}|F_n(x)-F_0(x)|
\end{align*}
has the same distribution as
\begin{align*}
\sup_{0\le t\le1}|H_n(t)-t|.
\end{align*}
[/step]