a discontinuous function the square of which is continuous

1.8k Views Asked by At

give an example of a discontinuous function the square of which is continuous. The domain is $[0,1]$.

I tried to use the indicator function of rationals, but its square is not continuous.

EDIT:I am sorry that I did not express the question clearly, but the function should be nowhere continuous on $[0,1]$.

2

There are 2 best solutions below

0
On BEST ANSWER

Let $A=\mathbb{Q}\cap [0,1]$ and define $f$ by $$f(x)=\begin{cases} 1 & x\in A \\ -1 & x\notin A \end{cases}$$

0
On

Try the function $f:[0,1] \to \mathbb{R}$ where

$$ f(x) \;\; =\;\; \begin{cases} 1, & \text{if} \; x \in \mathbb{Q} \\ -1, & \text{if} \; x \not\in\mathbb{Q} \end{cases}. $$