Can the limit of a product exist if neither of its factors exist?

Show an example where neither $\lim\limits_{x\to c} f(x)$ or $\lim\limits_{x\to c} g(x)$ exists but $\lim\limits_{x\to c} f(x)g(x)$ exists.

Sorry if this seems elementary, I have just started my degree…

Thanks in advance.

Solutions Collecting From Web of "Can the limit of a product exist if neither of its factors exist?"

For example $f(x)=0$ for $x\in\mathbb{Q}$, $f(x)=1$ for $x\notin\mathbb{Q}$,
$g(x)=1$ for $x\in\mathbb{Q}$, $g(x)=0$ for $x\notin\mathbb{Q}$.

Looking at the bigger picture a little, the idea behind most answers given works not just for product but also for sum, difference, quotient, exponent, and most other binary operations.

The common idea is that for many ways that f can vary, g can also vary in some way that cancels it out, making the product (or sum, etc.) constant. For instance, as long as $f(x) \neq 0$, setting $g(x) := \frac{1}{f(x)}$ makes their product $g(x)f(x)$ the constant function 1. Similarly, taking $g(x) := -f(x)$ would make their sum constant.

Now, look for some $f$, such that $\lim_{x \to c}f(x)$ doesn’t exist, but satisfying $f(x) \neq 0$ (or whatever other constraint was needed for defining $g$ above). One way to fail to converge, while avoiding 0, is to oscillate within some fixed strictly positive range, so as a first try, one might think of something like $f(x) := 2 + \sin(x)$. This is always non-zero, and its limit as $x \to \infty$ is undefined because of the oscillation; but this doesn’t work since we wanted the limit as some specific value, not at infinity.

So, change it to make those oscillations happen as $x$ approaches $0$ by inverting the argument, setting $f(x) := 2 + \sin \frac{1}{x}$ for $x \neq 0$ (and doing whatever we want for $x=0$, e.g. $f(0) = 1$). This now gives a function, continuous everywhere except at $x=0$, oscillating as $x$ goes to $0$ enough that $\lim_{x \to 0} f(x)$ doesn’t exist, and always non-zero so that we can set $g(x) = \frac{1}{f(x)}$.

This $f$ and $g$ are now as desired, since $f(x)g(x) = 1$ for all $x$, and so its limit is defined at any argument, in particular as $x \to 0$.

Neither of $$\lim_{x\to0}\left(2+\sin{\frac1x}\right)$$ and $$\lim_{x\to0}\left(\frac{1}{2+\sin{\frac1x}}\right)$$ exists, but $$\lim_{x\to0}\left(2+\sin{\frac1x}\right)\left(\frac{1}{2+\sin{\frac1x}}\right)=1.$$

Let $f$ be a function taking values between $1$ and (for instance) $2$ such that $\lim_{x\rightarrow c}f\left(x\right)$ does not exist. Then $g(x)=1/f(x)$ is well defined and $\lim_{x\rightarrow c}g\left(x\right)$ does not exist. This while $f(x)g(x)=1$ for every $x$.

If you accept divergence as well, $f(x)=g(x)=1/x$ has no limit at $0$, but $1/x^2$ diverges to infinity as $x$ goes to $0$.

I would like to reiterate a solution given above. Neither of the limits $$\lim_{x\to0}\left(\sin{\frac1x}\right), ~~~\lim_{x\to0}\left(\frac{1}{\sin{\frac1x}}\right)$$ exist, but $$\lim_{x\to0}\left(\sin{\frac1x}\right)\left(\frac{1}{\sin{\frac1x}}\right)=1.$$
I am aware that $ \large f(x) = \frac{1}{\sin{\frac1x}}$ has infinite discontinuities as x approaches zero. In particular the expression is undefined when $ f(\frac{1}{\pi n }) =\large \frac{1}{\sin{\frac{1}{ \left( \frac{1}{ \pi n } \right) }}} $. But I don’t see why this is a problem as far as the limit goes.