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.

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
$$
