In a question of an exercise, I have to “*express the following function in the interval $(0, 2)$* ” :

$fleft(xright)=left|x-2leftlfloorfrac{x+1}{2}rightrfloorright|$

My initial idea would be that I have to express the function without the absolute value…

Therefore, I tried working with inequalities, starting with

$0 le x le 2$ and $-x-1le :2lfloor frac{x+1}{2}rfloor < -x+1$ to get some significant result (i.e: the function is always positive or negative), however I didn’t get to anything meaningful when summing the two inequalities, and, by seeing the plot of $f$ without the absolute value, it is both positive and negative in this interval.

What am I supposed to do? Did I understand the question wrong?