
---
Commentary:
$\textbf{Exercise 9.}$ A function $f: \mathbb{R} \to \mathbb{R}$ is called periodic if there exists a positive number $p$ such that $f(x) = f(x + p)$ for all $x \in \mathbb{R}$. Is the set of periodic functions from $\mathbb{R}$ to $\mathbb{R}$ a subspace of $\mathbb{R}^\mathbb{R}$? Explain.
$\textbf{Solution 9.}$ Let $\mathbb{Z}$ denote the set of integers. Define $f, g: \mathbb{R} \to \mathbb{R}$ by $f(x) = \begin{cases} 0 & \text{if } x \notin \mathbb{Z}, \ 1 & \text{if } x \in \mathbb{Z} \end{cases} \quad \text{and} \quad g(x) = \begin{cases} 0 & \text{if } x \notin \sqrt{2}\mathbb{Z}, \ 1 & \text{if } x \in \sqrt{2}\mathbb{Z} \end{cases}$ for $x \in \mathbb{R}$. Then $f$ and $g$ are periodic functions (take $p = 1$ for $f$ and $p = \sqrt{2}$ for $g$).
Note that $\mathbb{Z} \cap \sqrt{2}\mathbb{Z} = {0}$ because $\sqrt{2}$ is irrational. Thus for each $x \in \mathbb{R}$, we see that $(f + g)(x) = 2 \text{ if and only if } x = 0.$ Hence if $p$ is a positive number, then $(f + g)(0) \neq (f + g)(0 + p)$. Thus $f + g$ is not periodic. Therefore, the set of periodic functions is not closed under addition and hence is not a subspace of $\mathbb{R}^\mathbb{R}$.
$\textit{Commentary:}$ This exercise demonstrates that the set of periodic functions, despite having a nice structure, is not a vector space under the usual function addition and scalar multiplication. The key idea is to construct two periodic functions whose sum is not periodic. Here, we choose one function that is periodic with period 1 and another that is periodic with period $\sqrt{2}$. Due to the irrationality of $\sqrt{2}$, the sum of these functions is not periodic.
This example highlights a common theme in mathematics: a set with some nice properties (like periodicity) may not necessarily form a vector space. It's important to always check the vector space axioms before assuming that a set is a vector space.
$\textit{Example:}$ Consider the set of functions from $\mathbb{Q}_p$ to $\mathbb{Q}_p$ that are periodic with period 1. This set is not a vector space over $\mathbb{Q}_p$. For example, the function $f(x) = |x|_p$ (the $p$-adic absolute value) is periodic with period 1, but $2f$ is not periodic because $|x|_p \neq |x+1|_p$ for some $x \in \mathbb{Q}_p$.
Similarly, the set of functions from $\mathbb{F}_q$ to $\mathbb{F}_q$ that are periodic with period 1 is not a vector space over $\mathbb{F}_q$. For instance, when $q = 3$, the functions defined by $f(0) = 0$, $f(1) = 1$, $f(2) = 0$ and $g(0) = 0$, $g(1) = 0$, $g(2) = 1$ are both periodic with period 1, but their sum is not periodic.
In the space of continuous functions on the unit circle, the set of periodic functions (i.e., functions satisfying $f(x) = f(x + 2\pi)$ for all $x$) is a vector space over $\mathbb{R}$ or $\mathbb{C}$. This is because the sum of two continuous periodic functions is periodic, and a scalar multiple of a continuous periodic function is periodic. This vector space is important in Fourier analysis.