Solve the equation
$$ \lfloor x^2\rfloor-3\lfloor x \rfloor +2=0 $$
where $\lfloor x\rfloor $ denotes floor function.
My Attempt:
Let $x = n+f$, where $n= \lfloor x \rfloor \in \mathbb{Z} $, $f=x-\lfloor x \rfloor = \{x\} $, and $0\leq f<1$. Then using $\lfloor n+f \rfloor = n$ gives us
$$ \begin{align} \lfloor (n+f)^2 \rfloor -3 \lfloor n+f \rfloor +2 &= 0\\ n^2+\lfloor f^2+2nf \rfloor -3n+2 &= 0 \end{align} $$
How can I solve the equation from here?
If $x$ is positive, then it must be at most $4,$ so $\lfloor x \rfloor$ is at most $3.$ If $\lfloor x \rfloor = 0,$ then your equation is $x^2 - 3 x +2 = 0,$ so $(x-1)(x-2) = 0,$ so no solutions. If $\lfloor x \rfloor = 1,$ then if $y$ is the fractional part of $x,$ we have: $\lfloor (y+1)^2 \rfloor - 1 = 0,$ so $\lfloor (y+1)^2 \rfloor = 1$, so any $y < \sqrt{2} - 1$ works. If $\lfloor x \rfloor = 2,$ then $\lfloor (y+2)^2\rfloor = 4,$ so any $y < \sqrt{5} - 1$ works. You get the picture.