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:**


1. 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$?
2. Is there some other way of showing that the map $p$ is measurable?



Is the map sending a continuous function to its period measurable?
Isn't the set $p^{-1}([0, T\_0])$ closed for every finite $T\_0$? Suppose that $f\_n$ has period $T\_n \leqslant T\_0$ and it converges locally uniformly to $f$. By passing to a subsequence, we may assume that $T\_n$ has a limit $T$. Uniform convergence of $f\_n$ on $[x, x + T\_0]$ implies that $$f(x + T) = \lim f\_n(x + T\_n) = \lim f\_n(x) = f(x),$$ and hence $f$ has period at most $T$.


