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?
 A: 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$.
A: 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.
A: 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$.
A: 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.

[Added:] To answer the objection under my answer, the badly written quoted problem implicitly assuming that the following "statement" is true:

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.

which is not a mathematical statement at all. 
