In $C[\mathbb{R}]$, if $d(f,g) = \infty$ then $f$ and $g$ are in different connected components. In my general topology course we were given the following problem

Consider the metric space of continuous functions with the supremum metric, that is, $C[\mathbb{R}]:= \{f:\mathbb{R} \to \mathbb{R} | \ f \text{ is continuous in the usual sense}\}$ with the topology induced by the metric $d(f,g) = \sup|f(x)-g(x)|$. Note that this metric isn't always finite.
Prove that if $\ d(f,g) = \infty \ $ then $\ f$ and $\ g$ are not on the same connected component.

My attempt was to show the converse: if they're both in the same connected component then they must be finitly distant.

Let $C$ be a connected component and take $f,g \in C$. Take the following $C$-open sets $F = C \cap \left( \bigcup_{n \in \mathbb{N}} B_n(f) \right)$ and  $G = C \cap \left(\bigcup_{n \in \mathbb{N}} B_n(f) \right)$.
Now (this I don't know/think its true), $C = F \ \cup \ G$, and since $C$ is connected, $F \ \cap \ G \neq \emptyset$. Take $h$ in the inteserction, then both $d(f,h), \ d(g,h)$ are finite and thus $d(f,g) \le d(f,h) + d(h,g) < \infty$. Done.

I'm not sure if those $F$ and $G$ work (note: if the statement is true, then $F$ and $G$ are exacly the connected components of $f\ $ and $g$), but I feel so close to finishing my proof. If I'm actually on the right track I would appreciate a hint on how to define/find the sets that will "split" $C$ conviniently.
Thanks in advance.
 A: There's a slight issue with proving that $C=F\cup G$. This is essentially equivalent to the statement you set out trying to prove, namely that everything in the same connected component is a finite distance from one another. Thus while you can prove $C=F\cup G$ (i.e., it is true), any proof of that requires showing that any other $h$ in $C$ is a finite distance from $f$ or a finite distance from $g$, which is only slightly weaker (and not in any useful way, as far as I can tell) that the statement that any $h$ in $C$ is a finite distance from $f$, which is your claim.
Thus you should just directly prove your claim.
The standard approach to this is outlined in the answer to this question.
The idea is that if you have a metric $d: X\to [0,\infty]$, define an equivalence relation on $X$ by $x\sim y \iff d(x,y) < \infty$. 
The equivalence classes of $\sim$ are all open, and thus also closed. Hence the connected component of any point $x$ is contained entirely in its equivalence class (which is what you wanted to show).
A: The proof using equivalence classes as in @jgon 's answer is perhaps the most natural one (each equivalence class is closed, as the complement of the union of the remaining equivalence classes, which are obviously open). 
Just to expand on my comment showing directly that $\cup_{n\in\mathbb{N}}B_n(f)$ is closed-and-open for each $f$, clearly it is open. To show that it is also closed, take any $h\in\overline{\cup_{n\in\mathbb{N}}B_n(f)}$. Then (taking $\varepsilon=1$) we have that $B_1(h)\cap(\cup_{n\in\mathbb{N}}B_n(f))\neq\varnothing$, so pick some $g\in\bigl(B_1(h)\cap(\cup_{n\in\mathbb{N}}B_n(f))\bigr)$. There is some $m$ with $g\in B_m(f)$. Then $d(f,h)\le d(f,g)+d(g,h)<m+1$ hence $h\in B_{m+1}(f)\subseteq\cup_{n\in\mathbb{N}}B_n(f)$. 
