2
$\begingroup$

Show that $f$ assumes every value between $0$ and $1$ if

$$f(x) = \begin{cases} x, & x\ \text{is rational},\\ 1-x, & x\ \text{is irrational} \end{cases}$$

for all $x\in[0,1]$.


Is it enough to say that since the rationals and the irrationals are dense in the reals, every $x\in[0,1]$ will be assumed by $f$?

$\endgroup$
2
$\begingroup$

It's not sufficient, no. A set can be dense without containing every value, e.g. $\mathbb{Q} \cap [0,1]$.

The answer is much simpler. Take any $y \in [0,1]$. If $y$ is rational, then $f(y) = y$ is a value assumed by $f$. On the other hand, if $y$ is irrational, $1-y$ is irrational too, and $f(1-y) = 1-(1-y) = y$ is also a value assumed by $f$. So every element of $[0,1]$ is assumed by $f$.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.