What's the role of domain compactness in the Ascoli-Arzela theorem? The problem
From what I've read in the literature I get the idea that domain compactness is quite crucial in the theorem, and yet looking at the proof it seems to me as an unnecessary assumption. I surmise I'm probably missing an important part of the picture. In order to fix some notation and say what I mean precisely, allow me to repeat the proof down here. I will assume we are all familiar with the notions of equicontinuity and uniform boundedness.
The theorem
If a family $\mathcal{F}$ of functions from [a,b] to $\mathbb{R}$ is uniformly bounded and  uniformly equicontinuous, then every sequence of functions in $\mathcal{F}$ admits a convergent subsequence.
Proof. Let us fix a sequence $(f_n)\subseteq\mathcal{F}$ and an enumeration $(q_n)$ of the rationals in $[a,b]$. Since the numeric sequence $\big(f_n(q_0)\big)_{n\in\mathbb{N}}$ is bounded, by the Bolzano-Weierstrass theorem, it admits a convergent subsequence $\big(f_{n_k}(q_0)\big)_{k\in\mathbb{N}}$, which defines a corresponding subsequence of functions $(f_{n_k})_{k\in\mathbb{N}}$. By the same token, the numeric sequence $\big(f_{n_k}(q_1)\big)_{k\in\mathbb{N}}$ admits a convergent subsequence $\big(f_{n_k}^{(1)}(q_1)\big)_{k\in\mathbb{N}}$, to which corresponds the subsequence of functions $(f_{n_k}^{(1)})_{k\in\mathbb{N}}$, and so on. Iterating this process by induction, we get an infinite chain of nested subsequences
\begin{equation}
(f_{n_k})_{k\in\mathbb{N}}\supseteq (f_{n_k}^{(1)})_{k\in\mathbb{N}}\supseteq (f_{n_k}^{(2)})_{k\in\mathbb{N}}\supseteq (f_{n_k}^{(3)})_{k\in\mathbb{N}}\supseteq \,...
\end{equation}
Consider now the `diagonal' subsequence $(f_{n_k}^{(k)})_{k\in\mathbb{N}}$. By construction, this sequence of functions converges at all rational points in $[a,b]$. Therefore, given a $q_m$ and an $\epsilon>0$ there is a $\nu\in\mathbb{N}$ such that
\begin{equation}
|f_{n_k}^{(k)}(q_m)-f_{n_h}^{(h)}(q_m)| \le \frac{\epsilon}{3},
\end{equation}
for all $k,h\ge\nu$. Furthermore by the uniform equicontinuity of $\mathcal{F}$, for any $x\in [a,b]$ there is an interval $J_x$ such that
\begin{equation}
|f_{n_k}^{(k)}(y)-f_{n_k}^{(k)}(z)| \le \frac{\epsilon}{3},
\end{equation}
for all $y,z\in J_x$ and all $k\in\mathbb{N}$. (#) These intervals form an open cover of $[a,b]$ from which we can extract a finite subcover $\{J_{x_1},\,...,J_{x_p}\}$. By the density of $\mathbb{Q}$, each of these intervals contains a point of $(q_m)$, and thus there is an $M\in\mathbb{N}$ such that every interval of the finite subcover contains a rational $q_m$ with $0\le m\le M$. Moreover, for any $x\in[a,b]$ there is a $J_{x_j}$ with $1\le j\le p$ containing a $q_m$ with $1\le m\le M$. (#) But then, chosen a $q_m$ lying in the same interval as $x$ and $k,h$ sufficiently large,
\begin{align}
&|f_{n_k}^{(k)}(x)-f_{n_h}^{(h)}(x)| \le\nonumber\\
&|f_{n_k}^{(k)}(x)-f_{n_k}^{(h)}(q_m)| + |f_{n_k}^{(k)}(q_m)-f_{n_h}^{(h)}(q_m)| + |f_{n_h}^{(h)}(q_m)-f_{n_h}^{(h)}(x)| \le\nonumber\\
&\hspace{3.5cm}\le\frac{\epsilon}{3} + \frac{\epsilon}{3} + \frac{\epsilon}{3} = \epsilon,
\end{align}
therefore the sequence is uniformly Cauchy and thus $(f_{n_k}^{(k)})_{k\in\mathbb{N}}$ converges uniformly.
The question
The entire part enclosed by the symbol (#) seems completely inessential to me. Why can't we just say that by the density of rationals, $J_x$ contains some $q_m$ and be done with it? If that was the case we would not even need to assume compactness to begin with! What am I missing here?
 A: I think an answer might go as follows. The theorem you wrote doesn’t say in which sense the subsequence converges.
If the theorem states that there exists a uniformly converging subsequence, then you need that the interval is at least bounded, see the example by Peter Morfe in the comments.
There are also “almost” counterexamples for bounded non-closed intervals, which are more subtle: the sequence
$$f_n\colon [0,1)\to\mathbb R,\;\;\;f_n(x)=\sin(\tan(2x/\pi)/n)$$
is uniformly bounded and equicontinuous, but not uniformly equicontinuous (check the difference e.g. here https://en.wikipedia.org/wiki/Equicontinuity) and it doesn’t go to 0 uniformly, but only locally uniformly.
On the other hand, if you ask for uniform equicontinuity of the family of functions (as the theorem actually does), I think the theorem still works for bounded non-compact intervals, such as $[a,b)$. In fact, from uniform equicontinuity you have in particular uniform continuity, which implies that you can extend the functions of your family $\mathcal F$ uniquely to be continuous functions on the closure of the domain. It is then an easy check that this new family of functions is still uniformly bounded and uniformly equicontinuous, but this time you are on a compact interval, so you can apply the theorem for the compact case and conclude.
It seems to me that in the proof you provided, if we are dealing with a bounded interval, what you say is enough and we don’t need the part enclosed in (#).
In case you want the theorem to state that the convergence is locally uniform, you just don’t need anything, as any interval is locally compact (see the theorem linked by Moishe Kohan). This also implies pointwise convergence, for which I think again what you say in the question (convergence on all rationals+equicontinuity) is enough. But I might miss something, maybe someone could elaborate more on this point.
