5. The integer part $[x]$ of a number $x$ is defined as the greatest integer $n$ such that $n \leqslant x$, for example, $[10]=10,[9.93]=9,\left[\frac{1}{9}\right]=0,[-1.7]=-2$. Find all solutions to the equation $\left[\frac{x-1}{2}\right]^{2}+2 x+2=0$.
Solution. From the equation, it follows that $2 x=2-\left[\frac{x-1}{2}\right]^{2}-$ is an integer. Therefore, either $2 x=n \in \mathbb{Z}$, or $x=n+\frac{1}{2} \quad(n \in \mathbb{Z})$. In this case, we need to separately consider the cases of even and odd $n$.

1) If $x=2 k$, then

$$
\begin{aligned}
& {\left[\frac{2 k-1}{2}\right]^{2}+2(2 k)+2=\left[k-\frac{1}{2}\right]^{2}+4 k+2=(k-1)^{2}+4 k+2=} \\
& =k^{2}-2 k+1+4 k+2=\left(k^{2}+2 k+1\right)+2=(k+1)^{2}+2 \geqslant 2
\end{aligned}
$$

Since the obtained expression is strictly positive, solutions of the form $x=2 k$ are impossible.

2) If $x=2 k+1$, then

$$
\left[\frac{2 k}{2}\right]^{2}+2(2 k+1)+2=k^{2}+4 k+4=(k+2)^{2}=0
$$

The obtained equation has a solution $k=-2$, which gives $x=-3$.

3) If $x=2 k+\frac{1}{2}$, then

$$
\begin{aligned}
& {\left[\frac{2 k-\frac{1}{2}}{2}\right]^{2}+2\left(2 k+\frac{1}{2}\right)+2=\left[k-\frac{1}{4}\right]^{2}+4 k+3=(k-1)^{2}+4 k+3=} \\
& =k^{2}-2 k+1+4 k+3=\left(k^{2}+2 k+1\right)+3=(k+1)^{2}+3 \geqslant 3
\end{aligned}
$$

Since the obtained expression is strictly positive, solutions of the form $x=2 k+\frac{1}{2}$ are impossible.

4) If $x=2 k+1+\frac{1}{2}$, then

$$
\begin{aligned}
{\left[\frac{2 k+\frac{1}{2}}{2}\right]^{2}+2\left(2 k+\frac{3}{2}\right)+2=\left[k+\frac{1}{4}\right]^{2} } & +4 k+3+2=k^{2}+4 k+5= \\
& =k^{2}+4 k+4+1=(k+2)^{2}+1 \geqslant 1
\end{aligned}
$$

Since the obtained expression is strictly positive, solutions of the form $x=2 k+1+\frac{1}{2}$ are impossible.

Answer. $x=-3$.