# $f(x)$ not continous at 0 but $f(x) + \frac{1}{f(x)}$ continuous at 0: Is my example valid?

I'm but a lowly electrical engineering student interested in mathematics. Recently, I've been working through the second edition of Stephen Abbott's Understanding Analysis and I encountered a problem that I'm not entirely sure about, specifically problem 4.3.6, part d, which states:

Provide an example or explain why the request is impossible: A function $f(x)$ which is not continuous at 0 such that $f(x) + \frac{1}{f(x)}$ is continuous at 0.

Now, being supremely lazy, my instinct at first was to say, "sure, consider the function $f:\mathbb{R} \to \mathbb{R}$ defined by $$f(x) = \begin{cases} 1, & \text{if x=0} \\ 0, & \text{if x \neq 0} \end{cases}"$$ Then, my reasoning was that the only way we can define $g(x) = f(x) + \frac{1}{f(x)}$ is via the restriction of $f$ onto the domain $\{0\}$. So, since 0 is clearly an isolated point in the domain of $g$, it follows that $g(x)$ must be continuous at 0.

Does this answer fit the "spirit" of the question? Or am I only allowed to choose an $f$ such that $g$ can have the same domain as $f$? Thanks for your help!

• For that $f$ we have that ${1\over f(x)}$ is not defined anywhere except at $0$. – Adam Hughes Jun 16 '17 at 19:19
• This looks like evading the question. It's not too hard to tweak this example to a genuine example, though. – Magdiragdag Jun 16 '17 at 19:23
• Solve f(x)=-1/f(x). – Jacob Wakem Jun 16 '17 at 19:44

Let $f$ be given by
$$f(x)=\begin{cases}C&,x>0\\\\\frac1C&,x\le0\end{cases}$$
where $C\ne1$, $C\ne 0$.
• Your solution won't work since $1/0$ is undefined. – Mark Viola Jun 16 '17 at 19:35