Euclidean distance between $x\in\mathbb{R}$ and $\{x\in\mathbb{R} \mid f(x)=0\}$ Is there a generic formula to calculate the distance between an arbitrary real number $x\in\mathbb{R}$ and $$\{x\in {\mathbb{R}}\mid f(x)=0\}$$ where we have little information about $f$? In fact, my primary objective is to establish an inequality between the distance above and $f(x)\cdot f(x)$. Any idea?
 A: No. Consider that this problem is equivalent to finding the roots of $f$ (if you knew the distance from $x$ to the nearest root, you could check only two points to find the root).
If you know the roots and they are countable, you can of course simply sort them and quickly find the one closest to $x$. 
As for finding the distance in practice, you can perform gradient descent or ascent on $f$ with a line search until you locate the root (note that you will need to look in both positive and negative directions to find the closest root -- the gradient of $f$ is not necessarily a reliable indicator of the right direction to search -- and you will need to deal with any critical point of $f$ you find along your search). Specialized algorithms can efficiently find the roots for some classes of function $f$, e.g. polynomials.
Edit: as for relating the distance to $f$, if you can bound $f'$ you can use those bounds to compute bounds on the distance, by way of the fundamental theorem of calculus. You can refine the bound by including more high-order information about $f$ at $x$.
