Example 1 The graph of the function $y=f(x)$ is symmetric to the graph of the function $g(x)=\log _{2} x(x>0)$ with respect to the origin, then the expression for $f(x)$ is ().
(A) $f(x)=\frac{1}{\log _{2} x}(x>0)$
(B) $f(x)=\log _{2}(-x)(x>0)$
(C) $f(x)=-\log _{2} x(x<0)$
(D) $f(x)=-\log _{2}(-x)(x<0)$