Let $f: \mathbb{R} \rightarrow \mathbb{R}$ a continuous function with the property $f(x)=f(x+\frac{1}{\sqrt{n}}),\forall x \in \mathbb{R},\forall n \in \mathbb{N}$.Prove that $f$ is constant.
Here is my attempt:
Let $x \in \mathbb{R}$.
Firstly we notice that $\forall n \in \mathbb{N}$ we have $f(-\frac{1}{\sqrt{n}})=f(0)=f(\frac{1}{\sqrt{n}})$
From this we can deduce that $$f(\frac{m}{\sqrt{n}})=f(0),\forall n \in \mathbb{N},\forall m \in \mathbb{Z}$$
Now $x=\frac{x \sqrt{n}}{\sqrt{n}}$ and $x-\frac{1}{\sqrt{n}}=\frac{x \sqrt{n}-1}{\sqrt{n}} \leqslant \frac{[x \sqrt{n}]}{\sqrt{n}} \leqslant x$
The sequence $x_n=\frac{m_n}{\sqrt{n}} \rightarrow x$ where $m_n=[x\sqrt{n}]$
and $f(x_n)=f(0), \forall n \in \mathbb{N}$
From continuity by taking limits we have that $f(x)=f(0)$
Thus $f(x)=f(0),\forall x \in \mathbb{R}$ proving that $f$ is constant.
Is my argument correct?
If not can someone provide me a hint?
Thank you in advance!