# Product of functions is $0$ but none of the functions is identically $0$?

Given that $f(x) \cdot g(x) = 0$ for all $x$ is it true that at least one of the functions is $0$ for all $x$?

The correct answer is this doesn't necessarily hold true. Can you give such example? I have a feeling this had something to do with piecewise functions.

• For all x, either f(x) is zero or g(x) is zero. But it is not true that either f(x) is zero for all x or g(x) is zero for all x. – user253751 Mar 2 '17 at 20:55

Let $f(x)$ be any function whose range is $\{0,1\}$, and let $g(x) = 1 - f(x)$.

For example, let $f$ be such that $f(0) = 1$ and $f(x) = 0$ for all $x \ne 0$.

• Not "any" function. Must be non-constant. If f=0 or f=1, then you don't have a counterexample. – Stefan Pochmann Mar 2 '17 at 16:16
• @Stefan Pochmann: The specification "whose range is {0,1}" implies $f$ is non-constant. – quasi Mar 2 '17 at 17:30
• "range" can also mean codomain, no? At least Wikipedia says so. – Stefan Pochmann Mar 2 '17 at 18:01
• @Stefan Pochmann: I meant the term "range" as is used in Calculus and Precalculus texts (at least the standard ones used in the U.S.). – quasi Mar 2 '17 at 18:18
• "Image" and "codomain" are both unambiguous. "Range" is ambiguous. – Patrick Stevens Mar 2 '17 at 21:18

One continuous example: $f(x)=|x|+x, g(x)=|x|-x$.

For any $x$, at least one of the functions must be $0$, but there is nothing stopping them from "sharing" the $x$-axis between them.

• Could this be made differentiable? – Ryan Mar 2 '17 at 15:12
• @Ryan Certainly. Just round the corner sufficiently. Look at, for instance$$f(x) = \cases{0 & if x \leq 0\\2xe^{-1/x^2} & if x > 0}$$ and correspondingly for $g(x) = f(-x)$. It's infinitely many times continuously differentiable, and if you draw it, it aligns with the graph of my examples above. It can even be done so that it's infinitely many times continuously differentiable, and equal to my original example above for all $x\notin (-1, 1)$, but that takes a whole lot more piecewise shenanigans. – Arthur Mar 2 '17 at 15:20
• "Alas, O flounder, my wife now wants a real analytic counterexample!" – hmakholm left over Monica Mar 2 '17 at 17:15
• @HenningMakholm I don't think that can be done, because $f^{-1}(\{0\})$ cannot have any boundary points. – Arthur Mar 2 '17 at 17:27
• @HenningMakholm That's impossible. Analytic functions are an integral domain: en.wikipedia.org/wiki/Integral_domain – mlainz Mar 2 '17 at 18:19

Rather than “piecewise” functions, this has to do with functions which are not analytic.

If $f$ and $g$ are analytic in a neighborhood $U$ of $x_0$, which means that their Taylor series at $x_0$ exist and converge to the functions in a neighborhood of $x_0$, then from $f(x)g(x)=0$ for $x\in U$, then either $f(x)=0$ for every $x\in U$ or $g(x)=0$ for every $x\in U$.

This is easy to prove in the context of holomorphic complex functions: if the set of zeros of a function which is holomorphic in an open connected set has an accumulation point, then the function is identically zero.

Thus all counterexamples to the assertion must not be analytic and the easiest way to produce nonanalytic functions is by using “piecewise definitions”.

A $C^{\infty}$ example: $$f(x)=\begin{cases} 0 & x\le 0 \\ e^{-1/x^2} & x>0 \end{cases} \qquad g(x)=\begin{cases} e^{-1/x^2} & x<0 \\ 0 & x\ge 0 \end{cases}$$ The function $$F(x)=\begin{cases} e^{-1/x^2} & x\ne0 \\ 0 & x=0 \end{cases}$$ is the prime example of a $C^{\infty}$ function which is not the sum of its Taylor series at $0$ (all derivatives at $0$ are $0$).

Of course, if you don't care about differentiability, simpler examples can be found: $$f(x)=x+|x|\qquad g(x)=x-|x|$$ needs no "piecewise definition”.

• One could argue that $|x|$ is a shortcut notation for a specific type of piecewise definition. Not a big deal. – Euro Micelli Mar 2 '17 at 15:54
• @EuroMicelli: One could—or one could define $\lvert x \rvert = \sqrt{x^2}$ (on the reals), needing no such hidden piecewise definition that I can see. :-) – wchargin Mar 2 '17 at 18:45
• @wchargin, touché. It really doesn't matter. "Piecemeal" is not a mathematical property of functions, it's a reflection of the limitations of the human feeble mind :-) – Euro Micelli Mar 2 '17 at 19:29

As a further fun example, the functions $$f(x) = \begin{cases}\exp\left[\frac{1}{x(x-2)}\right] & 0 < x < 2 \\ 0 & \mathrm{else}\end{cases}\;\;\;\; ;\;\;\;\; g(x) = \begin{cases}\exp\left[\frac{1}{x(x+2)}\right] & -2 < x < 0 \\ 0 & \mathrm{else}\end{cases}$$ satisfy $f(x)g(x) = 0$ for all real $x$ and are infinitely differentiable everywhere.

You can go even more basic, not worrying about continuity, holomorphicity or using modulus signs. Let $f,g : \{0,1\} \to \{0,1\}$ with $$f(0) = 0, f(1) = 1, g(0) = 1, g(1) = 0.$$ We then have $f(0)g(0) = 0*1 = 0 = 1*0 = f(1)g(1)$. (This is in essence the same as quasi's accepted answer, but giving an even more 'basic' function.)

$$f(x)\cdot g(x)=0\iff f(x)=0\lor g(x)=0.$$

Then take two distinct values $x_1,x_2$ and define the functions in such a way that $f(x_1)\ne0$ and $g(x_2)\ne0$ and zeroes everywhere else.

Inspired by Arthur's example, here's a differentiable example:

Let $f(x) = \text{max}(x^3,0)$ and let $g(x) = f(-x)$.

• eyeballfrog's example is much smoother than mine. – quasi Mar 2 '17 at 6:58
• You've just got to one-up me with $f, g \in C^\omega$. – eyeballfrog Mar 2 '17 at 7:11
• @eyeballfrog: Is that even possible? – quasi Mar 2 '17 at 7:21
• I'm pretty sure it's not. – eyeballfrog Mar 2 '17 at 7:24
• @eyeballfrog: As pointed out by mlainz in another comment, the $C^\omega$ functions on a connected subset of any manifold form an integral domain. So no, it's not possible. – Michael Seifert Mar 2 '17 at 21:55