What is the range of $$f(x)=\left[\frac{[x]}{x}\right]?$$
My textbook says the answer is the two-point set $\{0,1\}$, which I think means that the range is either $0$ or $1$. When I graph the function on my TI-nspire CX, I get a graph that has points on it whose $y$ values are indeed $0$ and $1$, but the graph also has points whose $y$ values are neither $0$ nor $1$. An example of this is the point $(-0.5,2)$. I don't understand this
I guess the textbook says that for $\,x \gt 0\,$, in which case it holds because:
$$ 0 \le \lfloor x \rfloor \le x \quad\implies\quad 0 \le \frac{\lfloor x \rfloor}{x} \le 1 \quad\implies\quad \left\lfloor \frac{\lfloor x \rfloor}{x} \right\rfloor \in \{0,1\} $$
For negative numbers, however, all positive integers are included in the range, since for $\,\forall n \in \mathbb{N}\,$:
$$\;\displaystyle\left\lfloor \frac{\lfloor −1/n \rfloor}{−1/n} \right\rfloor = \left\lfloor \frac{-1}{−1/n}\right\rfloor = \lfloor n \rfloor = n $$