Under a post in this forum, I found a comment (https://math.stackexchange.com/a/46936/1173827) by Beni Bogosel that mentions the problem of finding all solutions for a function $f:\mathbb{R}\rightarrow\mathbb{R}$ with the property $f(x)=f(\cos x), \forall x \in \mathbb{R}$.
Out of interest, I began searching for a solution. Immediately the solution $f(x)=0$ came to mind. The next set of solutions is $f(x)=k, k\in\mathbb{R}$.
But now I wondered if there are non-constant solutions. I figure that the domain of $f$ must be confined to the interval [-1,1], since this is the output range of $\cos(x)$.
For my first attempt I considered if $f(x)=g_1(x)+g_2(x)$, where the new two functions are switch functions that just turn into the other if $x$ or $\cos(x)$ is the input. But this is just a rephrasing of the problem and did not get me far.
Then I remembered that the question under which I found this problem was about a solution for $x=\cos(x)$, so I decided to approach the issue from that direction.
When plugging $\cos(x)$ into $f(x)$, I get
$$f(\cos(x))=f(\cos(\cos(x)))$$
But from the defining property of $f(x)$ I know that
$$f(x) = f(\cos(x))=f(\cos(\cos(x)))$$
I can repeat this forever until I have an infinitely nested $\cos(x)$ inside of $f(x)$ so that
$$f(x) = f(\cos(\cos(\cos( \cdots ))))$$
I know that these nested $\cos(x)$ approach a constant with the approximate value $q\approx0.739085$. But would this not imply that $f(x)=f(q)=k$ again?
Is it true then that all solutions for $f(x)=f(\cos(x))$ are just constant? Does a non-constant solution truly not exist?