What you are doing is not always allowed. In fact, it is only allowed if $f(x)\neq 0$ on some set $(a-\delta, a+\delta)\setminus\{a\}$. I will, from now on, assume that $f$ satisfies that property.
You can see that what you are doing is allowed by going to the definitions. So, let's write down what you know:
you know that (property 1)
$$\lim_{x\to a} f(x)=0$$
which means that for every $\epsilon >0$, there exists such a $\delta >0$ that for all $x$ such that $0<|x-a|<\delta$, you have $|f(x)|<\epsilon$.
Also (property 2):
You know that $$\lim_{y\to 0}\frac{\ln(1+y)}{y}=1$$
which means that for every $\epsilon >0$, there exists such a $\delta>0$ that for all $x$ such that $0<|y|<\delta$, you have $\left|\frac{\ln(1+y)}{y}-1\right|<\epsilon.$
Now, you are trying to prove that $$\lim_{x\to a}\frac{\ln(1+f(x)}{f(x)}=1$$
Take the usual steps:
- Let $\epsilon > 0$ be arbitrary.
- Now, take $\delta_1$ to be the value $\delta_1$ for which, if $0<|x|<\delta_1$, you know that $\left|\frac{\ln(1+y)}{y}-1\right|<\epsilon.$
- Now, if you can only get $f(x)$ under $\delta_1$, you can finish your proof. But wait, you can! You can set $\delta_2$ such that if $0<|x-a|<\delta_2$, then $|f(x)|<\delta_1$ (because of property number 1, setting $\epsilon=\delta_1$ in that property. Therefore, you will now determine that your final $\delta$ is equal to $\delta_2$.
OK, so you found a $\delta$, but is it correct? Is it true that if $0<|x-a|<\delta$, then $\left|\frac{\ln(1+f(x))}{f(x)}-1\right|<\epsilon$?
Well, if $0<|x-a|<\delta=\delta_2$, then you know, by property 1 and the definition of $\delta_2$, that $|f(x)|<\delta_1$. Getting close?