Let $(X_1, d_1),\ldots,(X_n, d_n )$ be metric spaces, $ X: = X_1 \times \cdots\times X_n$ be their Cartesian product with metric $d$. Let $ \pi_i : X \to X_i$ be the projection for $ 1 \le i \le n$.
Suppose $(X,d)$ satisfies:
for any metric space $A$, $ f: A \to X$ is continuous $\iff$ $ \pi_i \circ f $ is continuous for all $ 1 \le i \le n$.
Is it true that $ \pi_i(x_k) \to \pi_i (x) \in X_i$ for all $i$ $ \implies$ $ x_k \to x \in X$?
I've been trying for a long time. But can neither prove it nor give a couterexample.
Any help is appreciated.
Just take $A = X$, but NOT with metric $d$. Take $A = X$ with a metric $p$ that gives the product topology, like $p = \max d_i$ or $p = \sum d_i$. And take $f = \mathrm{id}: (X, p) \rightarrow (X, d)$.
Now, $\pi_i \circ \mathrm{id}: (X,p) \rightarrow X_i$ is certainly continuous, since $(X,p)$ has the product topology. So, you hypothesis imply that $f = \mathrm{id}$ is continuous.
To finish, you have to notice that (since we are in a metric space) $$ \forall i,\,\pi_i(x_n) \rightarrow \pi_i(x) \Leftrightarrow x_n \xrightarrow{p} x \Rightarrow \mathrm{id}(x_n) \xrightarrow{d} \mathrm{id}(x) \Leftrightarrow x_n \xrightarrow{d} x, $$ where the first "$\Leftrightarrow$" is due the product topology and the "$\Rightarrow$" is the continuity of $\mathrm{id}$.
Edit: Fixed according to comments. I had underestimated the OP... sorry! ;-)
Obs: Notice that the hypothesis does imply that $X$ has the product topology. For the proof above we only needed the "$\Leftarrow$" part of the hypothesis. The "$\Leftarrow$" implies that the topology of $(X,d)$ is weaker then the product topology. While the "$\Rightarrow$" part of the hypothesis implies that it is stronger.