Are metrics borel measurable functions? Let (X,d) be a polish space.
Does the metric d have to be measurable (regarding the Borel sigma-algebra in the product space)?
 A: If you just say "complete metric" but not "separable", then the answer can be negative.  Take $X$ of power greater than the continuum, and the discrete metric (all nontrivial distances are $1$) so that the algebra of Borel sets is the full power set.  But the diagonal in $X \times X$ is not measurable for the product sigma-algebra.  And thus the metric is not a Borel function.
A: The metric function is continuous, therefore measurable.
One can show that measurable functions can be built with a hierarchy similar to the Borel hierarchy. You start with continuous functions (into $\mathbb R$), then take pointwise limits, and reiterate $\omega_1$ many steps (each time taking pointwise limits of previously defined stages).
This is done by taking functions that preserve $\Sigma^0_\alpha$ and $\Pi^0_\alpha$ sets (i.e. a preimage of a $\Sigma^0_\alpha(\mathbb R)$ is $\Sigma^0_\alpha(X)$, similarly for $\Pi$. Continuous functions are indeed the first level, as preimage of open/closed set is an open/closed set), and prove by induction that the pointwise limits behave as we would like.
