How to solve $3\lfloor x \rfloor - \lfloor x^{2} \rfloor = 2\{x\}$? I am trying to solve the following question involving floor/greatest integer functions.  
$3\lfloor x \rfloor - \lfloor x^{2} \rfloor = 2\{x\}$ with the notations $\lfloor x \rfloor$ denoting the greatest integer less than or equal to $x$ and $\{x\}$ to mean the fractional part of $x$.  
I used the following property for floor functions.   
$n\leq x$ if and only if $n \leq \lfloor x \rfloor$ where $n\in \mathbb{Z}$ 
Let $p=\lfloor x^{2} \rfloor$, then 
$p\leq \lfloor x^{2} \rfloor < p+1$ 
$\rightarrow p \leq x^{2} < p+1$ 
$\rightarrow \sqrt{p} \leq x < \sqrt{p+1}$ , since $\sqrt{p} \in \mathbb{Z}$ 
$\rightarrow \sqrt{p} \leq \lfloor x \rfloor < \sqrt{p+1}$ We then have  $\sqrt{p} = \lfloor x \rfloor$
Since $\{x\}=x-\lfloor x \rfloor,$ 
$3\lfloor x \rfloor - \lfloor x^{2} \rfloor - 2\{x\}= 3\lfloor x \rfloor - \lfloor x^{2} \rfloor - 2(x-\lfloor x \rfloor)= 5\lfloor x \rfloor - \lfloor x^{2} \rfloor - 2x=0$
Substituting $p$, $\sqrt{p}$ for $\lfloor x^{2} \rfloor$ and $\lfloor x \rfloor$ respectively, and also letting $x= \sqrt{p}, $ we get  $p = 3\sqrt{p}$ solving for $p$ gives $p=0, 9$, and hence $x=0, 3$ 
The problem is that according to the solution for the problem, $x$ also equals to $\frac{3}{2}$ for $\{x\}=\frac{1}{2}$ since $2\{x\}\in \mathbb{Z}$.  However, by definition for $\{x\}$, $0 \leq \{x\} < 1$, then $0 \leq 2\{x\} < 2$.  How can $\{x\}=\frac{1}{2}$ and how do I use this to obtain $x=\frac{3}{2}$.  I am not sure what I am missing.  IF I made any mistakes in my reasoning.  Can someone point it out to me please.  Thank you in advance.
 A: Let $x = n + r$ where $n = [x]$ and $r = \{x\}$.
Then we have $3n - [n^2 + 2nr + r^2]=2r$
$3n - n^2 - [2nr + r^2] = 2r$
and.... oh, hey, the LHS is an integer the RHS being $2\{x\}$ means $\{x\} = 0$ or $0.5$.
Two options $x$ is an integer and $x = [x] = n$ and $r=\{x\} = 0$ and we have
$3n-n^2=0$ and $n^2 = 3n$ and $n= 0$ or $n = 3$.
So $x = 0$ and $x=3$ are two solutions.
(Check: $x=0\implies  3[x] - [x^2] = 3*0 - 0 = 0 = \{0\}$.  Check.  And $x = 3\implies 3[x]-[x^2] = 3[3]- [3^2] = 3*3-9 = 0=\{3\}$. Check.
And if $x = n + \frac 12$ and $r = \frac 12$ then
$3n - n^2 - [2n\frac 12 + \frac 14] = 2\frac 12$
$3n - n^2 - [n + \frac 14] = 1$
$3n -n^2 - n = 1$
$n^2 - 2n + 1 =0$ so $(n-1)^2 = 0$ and $n = 1$.
$x = 1+\frac 12 = 1\frac 12$.
(Check: If $x = 1.5$ then $3[x] - [x^2] = 3[1.5] - [1.5^2] = 3*1 - [2.25]=3-2=1 = 2*\frac 12 = 2\{1.5\}$.  Check.)
A: Write $\{x\}=x-\lfloor x\rfloor$. Then we have
$$
5\lfloor x\rfloor - \lfloor x^2\rfloor = 2x
$$Since the LHS is an integer, the RHS must be as well. There are two cases: $x$ is an integer, or $x$ is a half-integer.


*

*$x$ an integer. Drop the brackets:
$$
5x-x^2=2x;\qquad x=0,3
$$

*$x$ is a half-integer. Write $x=y+1/2$. Then $x^2 = y^2+y+1/4$, and again we can drop the brackets:
$$
5y-(y^2+y)=2y+1; \qquad y=1, x=3/2
$$
