Given two real numbers $a<b$, let $d(x,[a,b]) = \text{min} \{ \mid x-y \mid : a \leq y \leq b \} \text{ for } – \infty < x < \infty$. Then the function $$f(x) = \frac{d(x,[0,1])}{d(x,[0,1]) + d(x,[2,3])}$$ satisfies
- $0 \leq f(x) < \frac{1}{2}$ for every $x$
- $0 < f(x) < 1$ for every $x$
- $f(x)=0$ if $2 \leq x \leq 3$ and $f(x)=1$ if $ 0 \leq x \leq 1$
- $f(x)=0$ if $0 \leq x \leq 1$ and $f(x)=1$ if $ 2 \leq x \leq 3$