# If $f(x)$ is discontinuous at 0, does that mean $f(x) + \frac{1}{f(x)}$ is also discontinuous?

If $f(x)$ is discontinuous at 0, does that mean $f(x) + \frac{1}{f(x)}$ is also discontinuous?

I know that if $f(x)$ and $g(x)$ are both discontinuous at 0, that does not necessarily mean that $f(x) + g(x)$ is discontinuous at 0, (take $f(x) = \frac{1}{x}$ and $g(x) = x - \frac{1}{x}$), but I cannot think of an example to show $f(x) + \frac{1}{f(x)}$ is continuous even if $f(x)$ is discontinuous.

Does this mean that it is impossible?

• It might be interesting that the answer is different if you consider $f - 1/f$ (assuming $f>0$) instead of $f + 1/f$. – PhoemueX Apr 5 '16 at 15:59
• Actually, $x\to1/x$ is not discontinuous at $0$, it is undefined. This function happens to be continuous everywhere on its domain of definition. Common mistake. – Jean-Claude Arbaut Apr 5 '16 at 16:05

Consider the function: $$f(x)=\begin{cases}2 &\text{ if }x\ne0\\\frac12&\text{ if }x=0\end{cases}$$
Consider $$f (x) = \begin {cases} 2 , &\text{ if } x \in \Bbb {Q},\\ 1/2, &\text { if } x \notin \Bbb {Q}. \end {cases}$$ Then $f + 1/f \equiv 5/2$ is continuous, but $f$ is not.
If you allow complex-valued functions, it is easy to show that the answer is no: consider $$f(x) = \begin{cases} i & x\leq 0 \\ -i & x > 0 \end{cases}$$ Obviously $f(x)$ is discontinuous at $x=0$. However, if $x \leq 0$, $$f(x)+\frac{1}{f(x)} = i+\frac{1}{i} = 0,$$ and similarly, $-i+1/(-i)=0$. Hence $$f(x) + \frac{1}{f(x)} = 0$$ for any real $x$, which is obviously continuous.