This formula assumes that the function is twice differentiable. There exist continuous functions that are not differentiable. Some are differentiable but only once. For example you can take a function with constant curvature equal to let say 1 till p=1, and then continue with curvature 2 for p>1. Then curvature will have a jump from 1 to 2 in the point p=1. So f"(1) will be continuous but not differentiable: its left and right derivatives would differ.
Such a road would be rather smooth but more dangerous for cars, since they have to accelerate at this point. If you go further and make function f(p) not differentiable at some point, then even f" will not exist. Just think about road with an angle in some point. Traffic over such road will be even more problematic. That is why continuous curvature increases safety of traffic.