$f(y) = \frac{|y|}{y}= \left\{\begin{matrix} +1 & when \; y>0\\ -1 & when \; y<0 \end{matrix}\right.$
It is well-known signum function but in the given quetion, it is not defined for $y=0$
Here, $q$ is a non-zero real number.
So,
$(1)$ When $q>0$, then $|f(q)-f(-q)| = |(+1) - (-1)| = 2$ because when $q>0$ then $f(q)=f(>0)=+1$ and $q>0$ means $-q<0$ which implies $f(-q)=f(<0)=-1$
$(2)$ When $q<0$, then $|f(q)-f(-q)| = |(-1) - (+1)| = 2$ because when $q<0$ then $f(q)=f(<0)=-1$ and $q<0$ means $-q>0$ which implies $f(-q)=f(>0)=+1$
Correct Option: D.