Limit of real function, theoretical exercise I'm a freshman in mathematics and this is my exercise:


  Prove that for function $f:\langle -a,a\rangle\setminus\{0\}\longrightarrow\langle0,+\infty\rangle$ so that is
  $$\lim_{x\to 0} \left(f(x)+\frac{1}{f(x)}\right)=2$$
  is also
  $$\lim_{x\to 0} f(x)=1.$$


I've tried to solve this problem from the Cauchy's definition of limit
$$(\forall \varepsilon&gt;0) (\exists\delta&gt;0) (\forall x \in \langle -a,a\rangle\setminus\{0\})\qquad (0&lt; \lvert x-0\rvert  &lt; \delta) \implies \Big( \Big| f(x)+\frac{1}{f(x)} \Big| &lt; \varepsilon \Big)$$

by trying to get $\Big|f(x)-1\Big|&lt;\varepsilon $ but I got that just in case $f(x)\in\langle0,1]$.

Any thoughts on solving the problem this way or I should use another approach?
Notice that to prove $\lim_{x \to 0} f(x) = 1$, it is equivalent to show that for any sequence $\{x_n\}$ converging to $0$, we have 
$$\lim_{n \to \infty} f(x_n) = 1.$$ 

Let $\{x_n\}$ be any sequence converging to zero (for $\{x_n\}$ being contained in the domain of $f$, $\{x_n\} \subset (-a, a) \backslash\{0\}$). By condition, we have
$$\lim_{n \to \infty} \left(f(x_n) + \frac{1}{f(x_n)}\right) = 2,$$
which implies that the sequence $\left\{f(x_n) + \frac{1}{f(x_n)}\right\}$ is bounded above. Since $f(x_n) &gt; 0$ for each $n$, it follows that $0 &lt; f(x_n) &lt; f(x_n) + \frac{1}{f(x_n)}$, hence the sequence $\{f(x_n)\}$ is also bounded. By Bolzano-Weierstrass theorem, $\{f(x_n)\}$ contains a convergent sequence, say, $\{f(x_{n_k})\}$. 

Suppose that $\lim_{k \to \infty} f(x_{n_k}) = c \geq 0$. Clearly $c &gt; 0$, otherwise 
$$\lim_{k \to \infty} \left(f(x_{n_k}) + \frac{1}{f(x_{n_k})}\right) = 2 \tag{1}$$ would be violated. Therefore $\{1/f(x_{n_k})\}$ also converges with its limit $\frac{1}{c}$. Hence, $(1)$ gives that
$$c + \frac{1}{c} = 2.$$
Solving this for $c$, we obtain $c = 1$.

Now for any convergent subsequence $\{f(x_{n_m})\}$ of $\{f(x_n)\}$, similar argument as above gives that its limit must be $1$. Therefore $\lim_{n \to \infty} f(x_n) = 1$, and the proof is complete.
Notice that to prove $\lim_{x \to 0} f(x) = 1$, it is equivalent to show that for any sequence $\{x_n\}$ converging to $0$, we have 
$$\lim_{n \to \infty} f(x_n) = 1.$$ 

Let $\{x_n\}$ be any sequence converging to zero (for $\{x_n\}$ being contained in the domain of $f$, $\{x_n\} \subset (-a, a) \backslash\{0\}$). By condition, we have
$$\lim_{n \to \infty} \left(f(x_n) + \frac{1}{f(x_n)}\right) = 2,$$
which implies that the sequence $\left\{f(x_n) + \frac{1}{f(x_n)}\right\}$ is bounded above. Since $f(x_n) &gt; 0$ for each $n$, it follows that $0 &lt; f(x_n) &lt; f(x_n) + \frac{1}{f(x_n)}$, hence the sequence $\{f(x_n)\}$ is also bounded. By Bolzano-Weierstrass theorem, $\{f(x_n)\}$ contains a convergent sequence, say, $\{f(x_{n_k})\}$. 

Suppose that $\lim_{k \to \infty} f(x_{n_k}) = c \geq 0$. Clearly $c &gt; 0$, otherwise 
$$\lim_{k \to \infty} \left(f(x_{n_k}) + \frac{1}{f(x_{n_k})}\right) = 2 \tag{1}$$ would be violated. Therefore $\{1/f(x_{n_k})\}$ also converges with its limit $\frac{1}{c}$. Hence, $(1)$ gives that
$$c + \frac{1}{c} = 2.$$
Solving this for $c$, we obtain $c = 1$.

Now for any convergent subsequence $\{f(x_{n_m})\}$ of $\{f(x_n)\}$, similar argument as above gives that its limit must be $1$. Therefore $\lim_{n \to \infty} f(x_n) = 1$, and the proof is complete.