f(x)=1 if x is a prime number, 0 otherwise
You'll definitely need at least some assumptions like continuity, and probably uniform continuity, otherwise you could just make f(x) approximately zero except for at prime numbers, where it forms sharper and sharper spikes over time
Even then, if f(x) only had finite support, say f(x)=1 for x<6, f(x)=7-x if 6<x<7, 0 if x>7, then you will never get the difference to become small or the ratio of the two to become close to each other (I'm not sure exactly what you mean by ~ in this case but since for x>7 the two stop changing and are not equal to each other, it's obviously not the case that they become asymptotically close for any definition of asymptotic)