There isn't such a function. If $f$ is nonzero and continuous at some point $x$, then there is a neighbourhood of $f$$x$ on which $x$$f$ doesn't vanish. Hence if the zero set of zeros of $f$ is dense, then the function has to be discontinuous at every value on which it doesn't vanish.