If $\lim \limits_{x \to a}\left(f(x)+\frac{1}{f(x)}\right)=2,$ then $\lim \limits_{x \to a}f(x)=1$ [duplicate]
Let $f:(a-\epsilon,a+\epsilon)\to(0,\infty).$
If $$\lim \limits_{x \to a}\left(f(x)+\frac{1}{f(x)}\right)=2,$$ prove that $$\lim \limits_{x \to a}f(x)=1.$$
I'm trying to get something using $\epsilon-\delta$ definition but I'm stuck . How to use $(a-\epsilon,a+\epsilon)$ information I'm wondering .
$$~~$$ An answer
The assumption implies that $$\lim_{x\to a} \left(\sqrt{f(x)}-\frac{1}{\sqrt{ f(x)}}\right)^2=0,$$ hence $$\lim_{x\to a} \sqrt{f(x)}-\frac{1}{\sqrt{ f(x)}}=0.$$ Similarly, $$\lim_{x\to a} \left(\sqrt{f(x)}+\frac{1}{\sqrt{ f(x)}}\right)^2=4,$$ hence $$\lim_{x\to a} \sqrt{f(x)}+\frac{1}{\sqrt{f(x)}}=2.$$ Summing up and dividing by two we obtain $$\lim_{x\to a} \sqrt{f(x)}=1,$$ hence $$\lim_{x\to a} f(x)=1.$$