Give an example of a function $f:\mathbb{R} \rightarrow \mathbb{R}$ such that any rational number is its period but any irrational is not. Also, prove that there exists no function $g:\mathbb{R} \rightarrow \mathbb{R}$ such that any irrational is its period and any rational is not.
Solution
Solution