Question Find all continuous $f: \mathbb{R} \rightarrow \mathbb{R}$ such that $\sin(f(x)) = \sin(x)$ $\forall x \in \mathbb{R}$.
Here is my thinking for this problem:
Since $\sin(k\pi) = 0, \forall k \in \mathbb{Z}$ we require an $f$ which is an integer multiple of $\pi$ at integer multiples of $\pi$ and since $\sin$ is $2\pi$ periodic we require the 'translation' associated with periodicity to be an even multiple of $\pi$.
Because of continuity we require a linear solution and due to the fact that $\sin$ is odd, we require the coefficient of the $x$ term to be $1$.
Thus the only solutions take the form: $f(x) = x + 2m\pi, m \in \mathbb{Z}$.
My question is, have I missed any solutions? How might I know that these are the only ones?
For each $x \in \Bbb R$ you have $$ \sin(f(x)) = \sin(x) \Longleftrightarrow \begin{cases} f(x) = g_k(x) := x + 2k \pi \text{ for some } k \in \Bbb Z \\ \text{or} \\ f(x) = h_k(x) := -x + (2k+1) \pi \text{ for some } k \in \Bbb Z \\ \end{cases} $$ Those two families of curves intersect exactly at the points $x_i = (i + \frac 12)\pi$, $i \in \Bbb Z$.
Now suppose that $x_0 \in I = (x_{i-1}, x_{i})$, and $f(x_0) = g_k(x_0)$ for some $k$. Then there is some $\varepsilon > 0$ such that $|g_l(x_0) - f(x_0)| > \varepsilon $ for all $l \ne k$ and $|h_l(x_0) - f(x_0)| > \varepsilon$ for all $l$. $f$ is continuous, so there is a $\delta > 0$ such that $|f(x) - f(x_0)| < \varepsilon$ for $x \in (x_0 - \delta, x_0 + \delta)$ and therefore $f(x) = g_k(x)$ in that interval.
This shows that the set $\{ x \in I \mid f(x) = g_k(x) \}$ is open. Since it is closed as well and intervals are connected, we must have $f(x) = g_k(x)$ for all $x \in I$.
We have therefore shown: On each interval $(x_{i-1}, x_{i})$, $f$ is equal to some $g_k$ or some $h_k$.
In other words, $f$ is piecewise linear with $f(0) = k \pi$, $f'(0) = (-1)^k$ for some $k \in \Bbb Z$ and slope $+1$ or $-1$ on each interval $[(i - \frac 12)\pi, (i + \frac 12)\pi]$.