Find the roots of the equation $x^2-[x]=4$ where $[x]$ is the greatest integer less than or equal to $x$. Show that there is no rational number $x$ satisfying the equation $x^2-[x]=4$. Find the roots of the equation $x^2-[x]=4$ where $[x]$ is the greatest integer less than or equal to $x$.
I tried to solve this equation but stuck.
For the first part i supposed $x=\frac{p}{q}$ be the solution of the equation.
$$\frac{p^2}{q^2}-4=\left[\frac{p}{q}\right]$$
Now LHS is rational and RHS is an integer. Therefore our assumption is wrong. There is contradiction. So its roots are not rational.
$x^2-4=[x]\implies (x-2)(x+2)=[x]$
How should i move ahead? Please guide me. Its roots are $-\sqrt2,\sqrt6$.
Is my method of solving the first part correct?
 A: Write $x = [x] + \varepsilon$. Then you are trying to solve
$$n^2 + 2\varepsilon n + \varepsilon^2 - n - 4= 0 $$
For an integer value of $n$ and some $\varepsilon \in [0,1)$.  By the quadratic formula we can express $\varepsilon$ in terms of $n$,
$$\varepsilon^2 + (2n)\varepsilon +[n^2  - n - 4]= 0 $$
$$\varepsilon = \frac{-2n ± \sqrt{4n^2 - 4(n^2 - n - 4)}}{2} = -n ± \sqrt{n+4}$$
So now we want to find values of $n$ where
$$ -n + \sqrt{n+4} \in [0,1)$$
or $$-n -\sqrt{n+4} \in [0,1)$$
Lets try the first case, i.e. find $n$ such that
$-n + \sqrt{n+4} \in [0,1) $.
Both conditions below must hold for a solution:
$$ -n + \sqrt{n+4} \geq 0 \quad\text{ and } -n + \sqrt{n+4} < 1\quad$$
We try small values of $n\geq -4$,
$$\begin{array}{c|cccc}
n & -4 & -3 & -2 & -1 & 0 & 1 & 2 & 3\\ \hline
-n+\sqrt{n+4} & 4 & 4 & 2+\sqrt{2} & 1+\sqrt{3} & 2 & -1+\sqrt{5} & \color{red}{-2+\sqrt{6}} & -3+\sqrt{7}
\end{array}$$
There is no need to check $n<-4$ since $\sqrt{n+4}$ won't be defined, and no need to check $n>3$ since the gap only widens. ($-n + \sqrt{n+4}$ is decreasing for $n>3$).
so $n=2$ is the only solution for the first case, with $\varepsilon=-2+\sqrt{6}$ and $x=\sqrt{6}$.
Similarly for the second case, we need
$$ -n - \sqrt{n+4} \geq 0 \quad\text{ and } -n - \sqrt{n+4} < 1\quad$$
$$\begin{array}{c|cccccc}
n & -4 & -3 & -2 & -1 & 0 \\ \hline
-n-\sqrt{n+4} & 4 & 2 & \color{red}{2-\sqrt{2}} & 1-\sqrt{3}& -2 \\
\end{array}$$
There is no need to check $n\le-4$ or $n>0$, for similar reasons to the first case. Hence, the only two solutions to the whole problem are
$$ x=-\sqrt{2},\sqrt{6}.$$

Regarding the rest of the question as in your edit:
Your proof is incomplete. An integer is also rational! If $p/q$ is a solution, then we do indeed get $\frac{p^2}{q^2} - 4 = \left[\frac{p}{q}\right]$, but this itself is not a contradiction. It only means that $q^2=1$. Thus the equation reduces to
$$p^2 - p - 4 = 0, \quad p\in\Bbb Z$$
But of course the only real solutions to this are $\frac{1± \sqrt{1+16}}{2}$ which are not integers.
A: This seems like a strange problem.
Note that $[x] \le x$, so $x^2 - [x] = 4$ implies $x^2 - x \le 4$, so $\displaystyle x\le \frac{1-\sqrt{17}}2\approx -1.56$ or $x\ge \frac{1+\sqrt {17}}2\approx 2.56$.
Also, $[x] \ge x-1$, so $x^2 -[x] = 4$ implies $x^2 - (x-1) \ge 4$, so $x$ is between (approximately) $-1.79$ and $2.79$.
Combining these two equations tells us that solutions (if they do exist) are in the intervals $(-1.79,-1.56)$ and $(2.56,2.79)$. Hence, there may be a solution where $[x]=-2$ and one where $[x]=2$.
Now you break it into cases: If $[x]=-2$, then $x^2-(-2)=4$, which has two solutions ($\pm\sqrt2$). However, only one of these solutions ($-\sqrt2$) rounds down to $-2$.
Similarly, if $[x]=2$, then $x^2-2=4$, and only one solution exists with the right floor ($\sqrt6$).
A: Using $\displaystyle \bullet \lfloor x \rfloor \leq x$
So here Given $x^2-4 = \lfloor x \rfloor $
So we get $x^2-4\leq x\Rightarrow x^2-x-4\leq 0$
So we get $\displaystyle \frac{1-\sqrt{17}}{2}\leq x\leq \frac{1+\sqrt{17}}{2}$
So we get Approx $-1.6\leq x \leq 2.55$
So we get $\lfloor x \rfloor =-2,-1,0,1,2$
Now we will form Different cases.
$\; \bullet \; $ If $\lfloor x \rfloor  = -2\Rightarrow -1.66\leq x<-1\;,$ Put  into $x^2-4=\lfloor x \rfloor\;,$ we get $x^2-4=-2$
So we get $x^2=\left(\sqrt{2}\right)^2\Rightarrow x=\pm \sqrt{2}$
So we get $x=-\sqrt{2}\;,$ bcz above $-2\leq x<-1$.
$\; \bullet \; $ If $\lfloor x \rfloor  = -1\Rightarrow -1\leq x<0\;,$ Put  into $x^2-4=\lfloor x \rfloor\;,$ we get $x^2-4=-1$
So we get $x^2=\left(\sqrt{3}\right)^2\Rightarrow x=\pm \sqrt{3}$
So we get no real value of $x$ bcz above $-1\leq x<0$.
$\; \bullet \; $ If $\lfloor x \rfloor  = 0\Rightarrow 0\leq x<1\;,$ Put  into $x^2-4=\lfloor x \rfloor\;,$ we get $x^2-4=0$
So we get $x^2=\left(2\right)^2\Rightarrow x=\pm 2$
So we get no real value of $x$ bcz above $0 \leq x<1$.
$\; \bullet \; $ If $\lfloor x \rfloor  = 1\Rightarrow 1\leq x<2\;,$ Put  into $x^2-4=\lfloor x \rfloor\;,$ we get $x^2-4=1$
So we get $x^2=\left(\sqrt{5}\right)^2\Rightarrow x=\pm \sqrt{5}$
So we get no real value of $x$ bcz above $1\leq x<2$.
$\; \bullet \; $ If $\lfloor x \rfloor  = 2\Rightarrow 2\leq x<2.55\;,$ Put  into $x^2-4=\lfloor x \rfloor\;,$ we get $x^2-4=2$
So we get $x^2=\left(\sqrt{6}\right)^2\Rightarrow x=\pm \sqrt{6}$
So we get $x = \sqrt{6}$ bcz above $2\leq x<2.55$.
So we get $x=-\sqrt{2}$ and $x=\sqrt{6}$ are only two solution.
