<s>[INST] How to solve $2x+3[x]-4\{-x\}=4$? I am beginner to greatest integer and fractional part functions, and I just came across this problem:
$$ 2x+3[x]-4\{-x\}=4,$$
where $[x]$ and $\{x\}$ are the greatest integer and the fractional part functions, respectively.
What I have tried is taken $[x] = x $ as $ x-1≤[x]≤x$ but no ideas for fractional part of $x$. However, I know that $ \{x\} = x-[x]$.
How do I proceed further?
 [/INST] $$2x  +3 \lfloor x \rfloor - 4 \{-x\} = 4$$
Let $x = n+\alpha$ where $n$ is an integer and $0 \le \alpha < 1$.
Then ${-x} =
\begin{cases}
          0 & \text{If $\alpha = 0$.} \\
   1-\alpha & \text{If $\alpha \ne 0$.}
\end{cases}$
So, when $\alpha = 0$
\begin{align}
   2x  +3 \lfloor x \rfloor - 4 \{-x\} &= 4 \\
   2n  +3n - 4(0) &= 4 \\
   5n &= 4
\end{align}
Which has no integer solution.
When $0 < \alpha < 1$, 
\begin{align}
   2x  +3 \lfloor x \rfloor - 4 \{-x\} &= 4 \\
   2(n + \alpha)  +3n - 4(1-\alpha) &= 4 \\
   5n+6\alpha &=8
\end{align}
The only possible solution is $n=1$ and $\alpha = \dfrac 12$
So $x=1 \frac 12$
Check:
\begin{align}
   \left \lfloor 1 \frac 12 \right \rfloor &= 1 \\
  \left\{ -1 \frac 12 \right\} &= \frac 12 \\
\end{align}
So
\begin{align}
   2x  +3 \lfloor x \rfloor - 4 \{-x\} 
   &= 2\left( 1 \frac 12 \right)   
      + 3 \left \lfloor 1 \frac 12 \right \rfloor 
      - 4 \left\{ -1 \frac 12 \right\} \\
   &= 3 + 3(1) - 4\left( \frac 12 \right) \\
   &= 3 + 3 - 2 \\
   &= 4
\end{align}
</s>