Let $\mathbb{R}^X$ denote the set of all functions on a non-empty set $X$ to the real line $\mathbb{R}$, and for $f,g \in \mathbb{R}^X$, let $\displaystyle d(f,g)= \sup_{x \in X } \frac{|f(x)-g(x)|}{1+|f(x)-g(x)|}$. Prove that $(\mathbb{R}^X,d)$ is a metric space.
Attempt: It can be shown that $\frac{|f(x)-g(x)|}{1+|f(x)-g(x)|} \leq \frac{|f(x)-h(x)|}{1+|f(x)-h(x)|}+\frac{|h(x)-g(x)|}{1+|h(x)-g(x)|}$ [using $f(x)=x/(1+x)$ on $[0,\infty)$]. I am comfortable with establishing the inequality. After that $ \frac{|f-g|}{1+|f-g|} \leq \sup [\frac{|h-g|}{1+|h-g|}+\frac{|f-h|}{1+|f-h|}] ≤ \sup \frac{|h-g|}{1+|h-g|}+\sup \frac{|f-h|}{1+|f-h|}$.
Now taking sup over the left hand side establishes
$d(f,g) \leq d(h,g)+d(h,f)$. The other axioms can be verified as well.
Is this valid?
Additional question: Let us consider the set of all real valued functions on $\mathbb{R}$. Will $\sup|f-g|$ be a valid metric on it?