Formally
I am going to address the question for $\mathrm{Bernoulli}(1/2)$ measures, using probabilistic language. This is not a complete answer, but I am trying to relate your question to the properties of the distribution of $f(x)$. Clearly, for $x<1/2$ we never even reach zero, but my guess is that for $x>1/2$ this distribution is absolutely continuous, though I am unable to prove this at the moment.
So formally, at least,
$\displaystyle \mathsf{E} \, \sum_{f(x)=0} \mathsf{1}\{|f^\prime(x)| < \epsilon\} = \intop_0^1 \mathsf{E} \, \delta(f(x)) \mathsf{1}\{|f(x)|<\epsilon\} |f^\prime(x)| dx \le \epsilon \intop_0^1 \mathsf{E} \, \delta(f(x)) dx$.
$\mathsf{E} \, \delta$ is the density at zero, and it can be made perfect sense of, provided that the law of $f(x)$ has continuous density at zero. I don't know whether it has continuous density, but if we manage to prove that $f(x)$ has at least bounded density for $x>1/2$, then we can write inequalities with approximations of $\delta$ to get the same results...

