Question about limit of a product

Is it possible that both $\displaystyle\lim_{x\to a}f(x)$ and $\displaystyle\lim_{x\to a}g(x)$ do not exist but $\displaystyle\lim_{x\to a}f(x)g(x)$ does exist?

The reason I ask is that I was able to show that if $\displaystyle\lim_{x\to a}f(x)$ does not exist but both $\displaystyle\lim_{x\to a}g(x)$ and $\displaystyle\lim_{x\to a}f(x)g(x)$ do exist, then $\displaystyle\lim_{x\to a}g(x)=0$. However, I'm not sure whether the assumption on the existence of $\displaystyle\lim_{x\to a}g(x)$ is necessary.

-

Let $f(x) = g(x)$ be a function that is $1$ on the rationals and $-1$ on the irrationals.

-
This is a very neat example. – Michael Albanese Jan 16 '13 at 5:41

$f(x)=7+\sin(1/x)$, $g(x)=1/f(x)$, $a=0$.

-
I tried constructing a counterexample using $f(x) = \sin\left(\frac{1}{x}\right)$ but $g(x) = \frac{1}{f(x)}$ isn't defined on an open neighbourhood of $0$. By adding $7$, you get $f(x) \in [6, 8]$ so the corresponding $g$ is defined on $\mathbb{R}\setminus\{0\}$. Very nice. – Michael Albanese Jan 16 '13 at 5:40

Yes. As a simple example, I'll work with sequences. Let $f(n) = (-1)^n$ and $g(n) = (-1)^{n}$. Then $f(n)g(n) = 1$, so $1 = \lim_{n \to \infty} f(n)g(n)$, but neither of the individual limits exist.

-