Prove that a function $g$ has no roots

I saw this link and had a problem with the first proof on the accepted answer, namely: $\newcommand{\R}{\mathbb{R}}$ $\newcommand{\raw}{\rightarrow}$ $\newcommand{\N}{\mathbb{N}}$ $\newcommand{\Q}{\mathbb{Q}}$ $\newcommand{\Raw}{\Rightarrow}$

Suppose that $f:\R\raw\R$ and define a function $g:\R\raw\R$ by $g(x)=1/f(x)$. Prove that $g$ has no roots.

I found this hard to make sense of. For certain functions, for example $f(x) = x^2$ it is obvious that $1/f(x)$ will have no roots, however I became confused when considering the case $f(x) = 1/x^2$, because then $g(x) = x^2$ which has a repeating root at $(0,0)$. Can anyone explain to me where I am making a mistake?

• $f(x)=1/x^2$ is not a function on $\Bbb R$. Aug 28, 2017 at 16:11
• Your second $f(x)$ doesn't have $\Bbb R$ as its domain ($0$ is not in the domain). Aug 28, 2017 at 16:12
• The problem you quoted: "Suppose that $f:{\bf R}\to{\bf R}$ and define a function $g:{\bf R}\to{\bf R}$ by $g(x)=1/f(x)$. Prove that $g$ has no roots." is a badly written ill-defined one. When $0$ is in the range of $f$, it is nonsense to say "define a function $g:{\bf R}\to{\bf R}$ by $g(x)=1/f(x)$" and thus there is nothing to prove.
– user9464
Aug 29, 2017 at 20:28
• @Benjamin Did you mention to the author of the answer you are discussing here, that you were? You ought to.
– Did
Aug 31, 2017 at 8:27
– Did
Sep 14, 2017 at 8:50

As stated, there is no answer to the proposed claim because the domain of any such $g$ must be a subset of $\Bbb R-\{0\}$ for it to be defined. Thus if $g$ is defined, the range of the function $f$ must be a subset of $\Bbb R - \{0\}$.

To prove that $g$ has no roots, we can proceed as follows.

If we write $y = f(x)$, then $g(x) = 1/f(x) = 1/y$. Now we claim that $1/y \ne 0$. If this were so, then we could multiply by $y^2$ on both sides of our equation to obtain $0 = y^2\cdot 0 = y^2\cdot 1/y = y$. However, this says that $y = 0$, which is impossible because $y$ belongs to the range of $f$. We conclude that $g$ can have no roots.

Also, you apparently have some misunderstanding of the definition of a function. For instance, the map $x\mapsto 1/x^2$ is not a function $\Bbb R\to \Bbb R$, since it is not defined for $x = 0$.

Your issue is a misunderstanding of the notation $f:\mathbb{R}\to \mathbb{R}$.

In modern math, the notation $f:A \to B\;$means that $f$ is function whose domain is exactly equal to $A$, and whose range (or image) is a subset of $B$. In particular, if we have $f:A \to B$, then $f(x)$ is defined for all $x \in A$.

Thus, the notation $f:\mathbb{R}\to \mathbb{R}$ means that $f$ is a real-valued function such that $f(x)$ is defined, for all $x \in \mathbb{R}$.

Now suppose $f:\mathbb{R}\to \mathbb{R}$. If $f$ has a real root, $r$ say, there is no function $g:\mathbb{R}\to \mathbb{R}$ such that $g(x) = {\large{\frac{1}{f(x)}}}$, else $g(r)$ would be undefined. Based on that observation, the problem itself needs to be reworded so as to assert that $g(x)$ exists. So let's assume that the intended problem was this:

• Prove that if $f:\mathbb{R}\to \mathbb{R}$ and $g:\mathbb{R}\to \mathbb{R}$ are such that $g(x) = {\large{\frac{1}{f(x)}}}$, for all $x \in \mathbb{R}$, then $f,g$ have no real roots.

The proof is easy . . .

Let $r \in \mathbb{R}$.

If $r$ is a root of $f$, then $$g(r) = \frac{1}{f(r)} = \frac{1}{0}$$ which is undefined, contrary to the assumption that $g:\mathbb{R}\to \mathbb{R}$.

Hence $r$ is not a root of $f$.

If $r$ is a root of $g$, then \begin{align*} &g(r)=0\\[4pt] \implies\;&\frac{1}{f(r)}=0\\[4pt] \implies\;&f(r)\left(\frac{1}{f(r)}\right)=f(r)(0)\\[4pt] \implies\;&\require{cancel} \cancel{f(r)} \left( {\small{\frac{1}{\cancel{f(r)}}}} \right)=f(r)(0)\qquad\text{[since $f(r) \ne 0$]}\\[4pt] \implies\;&1=0\\[4pt] \end{align*} contradiction.

Hence $r$ is not a root of $g$.

It follows that $f,g$ have no real roots.

• "Your issue is a misunderstanding of the notation f:ℝ→ℝ" This might be an issue the OP is having, but the statement of the problem itself is faulty.
– Did
Aug 31, 2017 at 8:30

As $g(x):=1/f(x),$ we can write $f(x)=1/g(x)$, which would cause $f$ to be undefined at the roots of $g$.

• You wrote in a comment to another answer (presently deleted) that "the problem statement has no flaw". This assertion seems trivially wrong since, for some functions $f$ on $\mathbb R$, one cannot define $g$ on $\mathbb R$ as desired, thus the sentence "Suppose that $f:\R\to\R$ and define a function $g:\R\to\R$ by $g(x)=1/f(x)$", is absurd. One might want to state instead: "Suppose that $f:\R\to\R$ is such that $f(x)\ne0$ for every $x$ in $\mathbb R$, and define a function $g:\R\to\R$ by $g(x)=1/f(x)$ for every $x$ in $\mathbb R$".
– Did
Aug 31, 2017 at 8:37
• @Did: you can very well interpret the statement by "it is possible to define $g$ s.t. ...".
– user65203
Aug 31, 2017 at 8:39
• What? I am afraid you will have to be much more explicit and rigorous.
– Did
Aug 31, 2017 at 8:40
• But you did express the opinion that "the problem statement has no flaw", right? Against a user expressing the opinion that the problem statement is flawed, right? One day later, are you still of the opinion that "the problem statement has no flaw", or do you wish to reconsider?
– Did
Aug 31, 2017 at 8:51
• Apparently not. Why bother...
– Did
Sep 14, 2017 at 8:49

I would say that it is not your mistake but that the problem you quoted:

Suppose that $f:{\bf R}\to{\bf R}$ and define a function $g:{\bf R}\to{\bf R}$ by $g(x)=1/f(x)$. Prove that $g$ has no roots.

is a badly written ill-defined one. When $0$ is in the range of $f$, it is nonsense to say "define a function $g:{\bf R}\to{\bf R}$ by $g(x)=1/f(x)$" and thus there is nothing to prove.

Suppose that $f:{\bf R}\to{\bf R}$ and define a function $g:{\bf R}\to{\bf R}$ by $g(x)=1/f(x)$. Then $g$ has no roots.
• Your answer is ill-written because it does not consider the case of $f$ having no root, which is perfectly legitimate. For example by the given theorem, $1/(x^2+1)$ can't have a root.
• My point is clear, and you know it: the problem statement has no flaw. If the functions $f$ and $g$ are everywhere defined, $g$ can't have a root. (And neither can $f$, but this is not asked to be proved.)