1
$\begingroup$

I was wondering whether this following is a good proof:

Question:

Suppose that $f$ and $g$ are continuous functions and that for all $x$ we have $f(x)^2 = g(x)^2$. Suppose also that $f(x) \ne 0$ for all $x$. Prove that either $f(x) = g(x)$ or $f(x) = -g(x)$ for all $x$.

Proof:

Suppose that we have $f(x)^2 = g(x)^2$, $f(x) \ne g(x)$ and $f(x) \ne -g(x)$. Then we see that

$$ f(x) \ne g(x) \wedge f(x) \ne -g(x) $$ so (remembering that $f(x) \ne 0$ for all $x$) $$ f(x)^2 = f(x)f(x) \ne g(x) g(x) = (-g(x))(-g(x)) = g(x)^2$$

This is a contradiction, which proves the assertion.

  • 1
    Not really. You seem to be thinking of it pointwise, while you should be thinking function-wise (i.e., you need to prove that either $f(x) = g(x)$ for all $x$, or $f(x) = -g(x)$ for all $x$). Among other things, you haven't used the continuity of $f$ and $g$, which are important.2012-12-04
  • 0
    @JonathanChristensen But does this not hold for every point $x$?2012-12-04
  • 0
    @providence It does, but it doesn't prove the result you want. It could be that on all the rationals, $g(x) = f(x)$, but on all the irrationals, $g(x) = -f(x)$.2012-12-04
  • 1
    @Stuart: Your example violates the condition that $f$ be nowhere $0$.2012-12-04
  • 0
    The domain of $f$ and $g$ should be stated. Presumably both are defined and continuous on the entire real line? Connectedness of the domain suffices.2012-12-04

1 Answers 1

2

You should be immediately suspicious of your argument, because it doesn’t use the continuity of $f$ and $g$. What if $f(x)=1$ for all $x\in\Bbb R$, and $$g(x)=\begin{cases}-1,&\text{if }x<0\\1,&\text{if }x\ge 0\;?\end{cases}$$

Then $f^2=g^2$, but $f$ is neither $g$ nor $-g$. Of course it’s also true that $g$ is not continuous, but you didn’t use continuity in your argument, so if your argument were correct, this example couldn’t exist.

The real point of the exercise is to show that if $f$ and $g$ are continuous, you can’t have an example like this in which $f(x)=g(x)$ at some points $x$ and $f(x)=-g(x)$ at other points $x$.

HINT: If $f$ is continuous and never $0$, then by the intermediate value theorem either $f$ is strictly positive, or $f$ is strictly negative.

  • 0
    Ah, yes I see now. Thank you for your help. I just had this question on an exam and I knew there was something wrong with my answer. Hopefully I will at least get a partial mark.2012-12-04
  • 0
    @providence: You’re welcome.2012-12-04