# F^2=f but f=/=1 and f=/=0?

1. Mar 28, 2013

### robertjordan

1. The problem statement, all variables and given/known data
Show there exists a function $f: \mathbb{R} \rightarrow \mathbb{R}$ s.t. $f^2=f$ but $f\neq{0,1}$.

2. Relevant equations

Here $f^2=f$ means for arbitrary $a\in{\mathbb{R}}, f(a)^2=f(a)$

3. The attempt at a solution

I came up with the function $f(a)= \begin{cases} 0, & \text{if }a\text{> 0 } \\ 1, & \text{if }a \leq 0 \end{cases}$

What do you guys think? Is this right? I figured the only real numbers r for which r^2=r are r=0 and r=1 so the function f will have to only spit out those values or else there would be some input a for which f(a)^2=/=f(a)

Last edited: Mar 28, 2013
2. Mar 28, 2013

### Staff: Mentor

Make that:
$f(x)= \begin{cases} 0, & \text{if }x > 0 \\ 1, & \text{if }x \leq 0 \end{cases}$

What you have works, but I don't think it's what the write of the problem had in mind. Instead, I think they had a kind of identity function in mind - one whose output is the same as its input.

3. Mar 28, 2013

### robertjordan

But we need $f(a)^2=f(a)$ for all real numbers a. If we make $f(a)=a$, then in order for $f(a)^2=f(a)$, we would need $a^2=a$ which is clearly not true in general...

Can you elaborate some more on what you mean? I think I missed it...

4. Mar 28, 2013

### Stimpon

Assuming that robertjordan hasn't completely misunderstood the question, they definitely aren't looking for an identity function.

Normally $f^{2}=f \circ f$, so I think Mark44 thought that that's what the question writer meant by $f^{2}$. Certainly if the question writer did mean $f \circ f$ then a (the) real identity function would be correct, but you clarified that the writer meant $f \cdot f$ so Mark44 is wrong.

5. Mar 28, 2013

### Staff: Mentor

The notation used here is confusing to me, and appears to be in contradiction to itself.
f2 as used above normally indicates function composition, as in f(f(x)).
To my mind, the notation used immediately above contradicts the meaning at the top of this page. Even if f2 denotes multiplication, it should be written as [f(a)]2 to be clear.

6. Mar 28, 2013

### Stimpon

As an aside, if $f^{2}$ was being used to mean $f \circ f$, then the function given wouldn't work because we would have $f^{2}(x)=f(0)=1$ for $x>0$.

ETA: As well as $f^{2}(x)=f(1)=0$ for $x \leq 0$.

Last edited: Mar 28, 2013