Existence of an Injective Function from a Metric Space into $I^J$ I'm working on the following:
For a non-empty set $J$ consider $I^J=[0,1]^J$ with the standard product topology, and for every $j \in J$ let $\pi_j:I^J \rightarrow I$ be the projection onto the $j$th coordinate, that is, $\pi_j(x)=x(j)$ for every $x \in I^J$.
(a) Prove that for every non-empty $J$ and every topological space $X$ a function $f:X \rightarrow I^J$ is continuous if and only if for every $j \in J$ the mapping $\pi_j \circ f$ is continuous.
(b) Use part (a) to prove that for every metric space $X$ there is a non-empty set $J$ and a continuous one-to-one mapping from $X$ into $I^J$.
My work so far:
Part (a):
Suppose that $f:X \rightarrow I^J$ is continuous.  Since $\pi_j$ is continuous (as it is a projection map), the composition $\pi_j \circ f$ is continuous as a composition of continuous functions.
Now suppose that $(\pi_j \circ f):X \rightarrow I$ is continuous.  Then if $V$ is open in $I$, $(\pi_j \circ f)^{-1}(V)$ is open in X.
Now $(\pi_j \circ f)^{-1}(V)=(f^{-1} \circ \pi_j^{-1})(V)=f^{-1}[\pi_j^{-1}(V)]$.
$\pi_j^{-1}(V)$ is open in $I^J$, as projection maps are continuous.  Since $f^{-1}[\pi_j^{-1}(V)]$ is known to be open in X, the inverse image of $\pi_j^{-1}(V)$ under $f$ is open in X.  Hence $f$ is continuous.
Part (b):
I'm a little stuck here.  So far, I've said the following:
Let $X$ be a metric space with metric $d$, and let $J$ be a nonempty set.  Fix $x \in X$, and let $d':X \rightarrow \mathbb{R}$ represent the distance from $x$ to a given point $y$ in the metric $d$.
Now consider the standard bounded metric $\overline{d}:X \rightarrow [0,1]$ on $X$ given by
$\overline{d} (y) = \text{min}\{d(y), 1\} \hspace{0.1in} \text{for} \hspace{0.1in} y \in X$
This is a metric which gives the same topology as $d$, and it is also a continuous function.
My first questions are these: does my proof for (a) look solid? and does this seem like a good start for (b), or am I way off-base?
If this is a good start for (b), I'm thinking to maybe say something like "let $\overline{d}(y)=(\pi_j \circ f)(y)$.  Then $f(y)=(\pi_j^{-1} \circ \overline{d})(y)$."  Then since $\overline{d}$ is continuous, $f$ should also be continuous.  Then it would still remain to show that this function is injective for some set $J$, which feels like it might be a little non-standard, but I haven't gotten that far yet.
Any thoughts, tips, or critiques would be incredibly helpful!
 A: Define $f: X \to I^X$ by sending a point $x$ to the map $g_x(y) = \max\{d(x,y),1\}$.
If $g_x=g_y$ then $g_x(x)=g_y(x)$, which means that $d(x,y)=0$ so $x=y$. Hence $f$ is injective.
We know $f$ is continuous by Part 1, since $(\pi_y \circ f)(x) = g_x(y) = \max\{d(x,y),1\}$ is continuous in the $x$ variable, for each individual $y$.
A: For part (a) you should also consider what happens under FINITE intersections (over different $j$'s). 
For part (b) I think the trick is to use $J=X$ and then use something like e.g. $d(x,t)/(1+d(x,t))$ to get continuity and injectivity at the same time ($x$ the variable in the source space, $t$ the index set in the destination).
Added: For part (a): A base for the topology in $I^j$ consists of sets of the form $$N=I_{i_1}\times \cdots \times I_{i_n} \times \prod_{i\in J\setminus \{i_1,...,i_n\}} I$$ where $n<\infty$,  $i_1,...,i_n\in J$ and each $I_{i_k}\subset I$ is open. The preimage of $N$ by $f$ is now (check this) $f^{-1}(N)=\cap_{1\leq k\leq n} (\pi_k \circ f)^{-1}(I_k)$ which is a finite (important!) intersection of open sets, whence open.
