# Is this a correct proof of a function's continuity?

Tags:
1. Nov 17, 2015

### 0x95

Hello,
1. The problem statement, all variables and given/known data

1) Let f(x) continuous for all x and (f(x)2)=1 for all x. Prove that f(x)=1 for all x or f(x)=-1 for all x.
2) Give an example of a function f(x) s.t. (f(x)2)=1 for all x and it has both positive and negative values. Does it contradict (1) ?

2. The attempt at a solution
1) f(x)2 = 1 → f(x)=±1 → f(x) = 1 ∨ f(x) = -1 (since f(x) can't be both)
2) There's no such function.
A step function s.t.

I consider incorrect since in this case f(x) =1 or f(x)=-1 not for all x but f(x)=1 for some domain and f(x)=-1 for another domain.

Is this a correct solution ?

Thank you

2. Nov 17, 2015

### geoffrey159

No, you have to show that $f$ is always equal to 1, or always equal to -1.

3. Nov 17, 2015

### 0x95

That's what I've shown in (1), that f(x)=1 for all x or f(x)=-1 for all x

4. Nov 17, 2015

### geoffrey159

No, you only show that for any $x$, $f(x) \in \{-1,1\}$, which is not the same thing

EDIT: Why is it impossible to have $x_a,x_b\in\mathbb{R}$ such that $f(x_a) = 1$ and $f(x_b) = -1$ ?

Last edited: Nov 17, 2015
5. Nov 17, 2015

### 0x95

ok, I see. a function can be a two-point function.
and for (1) would it be correct to say that:
lim f(g(x))=f(lim g(x) ):
lim (g(x)) ^ 2 = (lim g(x) ) ^ 2 = 1 -> lim g(x) = 1 or lim g(x) = -1

6. Nov 17, 2015

### geoffrey159

Why do you talk about limits? You are not looking for a local property, but a global one, aren't you ?

EDIT: Following the hint given in post #4, what kind of set would be $f([x_a,x_b])$ and why would it be absurd given that $1,-1 \in f([x_a,x_b])$ ?

7. Nov 18, 2015

### 0x95

Would you elaborate more on your last post, I didn't quite get you.
Thanks

8. Nov 18, 2015

### geoffrey159

The nature of $f([x_a,x_b])$ is given by the intermediate value theorem.

9. Nov 18, 2015

### pasmith

This is a function such that $f(x)^2 = 1$ for all $x$ and takes both positive and negative values. Another example is $$f(x) = \begin{cases} 1 & x \in \mathbb{Q}, \\ -1 & x \notin \mathbb{Q}.\end{cases}$$ Indeed the number of such functions is equal to twice the number of ways of partitioning the reals into two disjoint non-empty subsets.
But do any of these functions contradict the assertion that a continuous function $f$ satisfying $f(x)^2 = 1$ for all $x$ must be constant?