I was trying to find the values of $x$ that makes the equation $[x^2]=[x]^2$ true where $[\cdot]$ denotes the floor function. I tried doing the following:
Let $x=n+r$ where $n=[x]$ and $0\leq\ r<1$. Then $x^2=n^2+2nr+r^2$ which implies that $[x^2]=[n^2+2nr+r^2]=n^2+[2nr+r^2]=[x]^2=n^2$. Subtracting both sides of the equation by $n^2$ I obtained $[2nr+r^2]=0$ if and only if $0\leq\ 2nr+r^2<1$. I got stucked in here. Any suggestions or hints that can you give me?
$$0\leq\ 2nr+r^2<1$$
Solve$$ 2nr+r^2-1=0$$ for $r$ in terms of $n$.
$$ r=-n\pm \sqrt {n^2+1} $$
For $$-n- \sqrt {n^2+1} <r< -n+\sqrt {n^2+1}$$
We get $$0\leq\ 2nr+r^2<1$$
Since $r\ge 0$, we just need $$ r< -n+\sqrt {n^2+1}$$
For example if $n=10$, we have to have $r<\sqrt {101}-10 \approx 0.049875$