Function to count how many times any arbitrary function equates to $0$ within a specific range?

71 Views Asked by At

Suppose I have an unknown function, $f(x)$ which equals zero from time to time.

Is there a function, $g(f(x), a)$ which can tell me how many times $f(x)$ equates to $0$ in the range $[0,a]$?

I need to use a function like this for something I'm working on, if one doesn't exist does anyone have any idea how I might go about making one? I'm assuming sigma sums and integrals are likely to be involved.