Let $C(\mathbb{R})$ be the space of continuous functions from $\mathbb{R}$ to $\mathbb{R}$ with the compact-open topology, and the associated Borel $\sigma$-algebra. Consider the function $p$ from $C(\mathbb{R})$ to $\mathbb{R}_{\geq 0} \cup \{\infty\}$ that maps a continuous function to its period, with the convention that non-periodic functions get mapped to $\infty$. Is the function $p$ a measurable function on $C(\mathbb{R})$? The only way I know of constructing measurable functions is to realize them as iterated lim, limsup, or liminf of a sequence of continuous functions. It's not clear here what continuous functions approximate the period in any reasonable manner.

**Questions:**

Is there a way to approximate the period of $f \in C(\mathbb{R})$ using a continuous map from $C(\mathbb{R})$ to $\mathbb{R}$, which on taking appropriate limits, converges to the described function $p$?

Is there some other way of showing that the map $p$ is measurable?