Denote by $\mathcal{H}$ the set of continuous maps $ h:\mathbb{R}\rightarrow \mathbb{R}$ such that $h(0)=0$. We endow $\mathcal{H}$ with the supremum metric $$ \widehat{d}(f,g)=\sup\{\vert f(x)-g(x)\vert: x\in \mathbb{R}\}. $$ Note that $d:\mathcal{H}\times \mathcal{H}\rightarrow \mathbb{R}\cup \{\infty\}$. Given $f\in\mathcal{H}$, we define $\mathcal{B}_f=\{ h\in\mathcal{H}: \widehat{d}(f,h)<\infty\}$ and $d_f=\widehat{d}_{|\mathcal{B}_f}$. It follows that $\mathcal{H}$ can be written as a union of metric spaces $(\mathcal{B}_f,d_f)$.
(*) I think the subsets open and closed of $\mathcal{H}$ are unions of subsets $\mathcal{B}_f$.
But I can only show is that the subsets $\mathcal{B}_f$ are connected components of $ \mathcal{H} $(then, $\mathcal{B}_f$ is open and closed)
I appreciate if you could give me some suggestions to show (*) .
In any topological space $X$, if $A\subseteq X$ is open and closed, then $A$ is a union of connected components of $X$. Indeed, if $C\subseteq X$ is any connected component, then $C\cap A$ is open and closed in $C$ and hence either $\emptyset$ or all of $C$, since $C$ is connected. So $A$ is the union of all the connected components it intersects.
This shows that in your case, any open and closed set is a union of the sets $\mathcal{B}_f$. Conversely, you need to show that any such union is open and closed. But any such union is open (since each $\mathcal{B}_f$ is open), and its complement is also a union of sets of the form $\mathcal{B}_f$, so the complement is also open.
More generally, this shows that whenever you can partition a space into open connected subsets, the open and closed subsets of the space are exactly unions of sets in the partition.