Is the map sending a continuous function to its period measurable?

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?

• One way of extracting the period of a function is taking the Fourier transform, see for example this signal processing post. You get a Dirac comb, the width of which is inversely proportional to the period. This operation is continuous, because the compact-open convergence implies convergence as a tempered distribution. However, I don't know if this is useful for you. – Giuseppe Negro Oct 29 '19 at 13:40
• Is it clear that $p$ is well-defined? To me it is not completely obvious that an arbitrary continuous function is either non-periodic or has a unique period. – B K Oct 30 '19 at 0:57
• @BK: $\inf \{ t \in \mathbb{R}^+ | (\forall x \in \mathbb{R}) f(x+t) = f(x) \}$ – R.. GitHub STOP HELPING ICE Oct 30 '19 at 1:57

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$$.
• Thanks! I guess I was just looking at the problem the wrong way. And from the fact that $p$ is upper semicontinuous, it shouldn't be too hard to find explicitly find continuous functions that approximate the period as well. – sayantankhan Oct 29 '19 at 13:18