Theorem:
Let $\mathbf{f}: S \to \mathbb{R}^n$, where $S \subseteq \mathbb{R}^n$. $\mathbf{f}$ is continuous if and only if its components $\mathit{f}_k, k = 0, \dots, n-1$ are continuous.
Continuity is defined as $$\lim_{\mathbf{x} \to \mathbf{x}_0} d(\mathbf{f}(\mathbf{x}), \mathbf{f}(\mathbf{x}_0)) = 0$$ The only properties known about $d: \mathbb{R}^n \to \mathbb{R}^n$ is that it satisfies the triangle inequality, is symmetric, and $d(\mathbf{u}, \mathbf{v}) = 0 \Leftrightarrow \mathbf{u} = \mathbf{v}$.
How to prove this theorem? I tried to use triangle inequality with the midpoint being $\mathbf{x}_0 + \lambda \mathbf{e}_{k_0}$, but I do not know how to proceed. If the theorem is not true, what would be a counterexample?
Note that it is sufficient to prove that $\pi_k:\Bbb{R}^n\to \Bbb{R}$ (the projection onto the $k^{th}$ factor) is continuous (which is easy), because then $f_k=\pi_k\mathbf{f}$ is the composition of two continuous functions and is hence continuous.
Conversely, if each $f_k$ is continous, show that $\lim_{\mathbf{x} \to \mathbf{x}_0} d(\mathbf{f}(\mathbf{x}), \mathbf{f}(\mathbf{x}_0)) = 0$ using the fact that $\lim_{\mathbf{x} \to \mathbf{x}_0} d(f_k(\mathbf{x}), f_k(\mathbf{x}_0)) = 0$ (here you could use metrics that are more convenient than the usual one, e.g., the maximum metric).