# inverse functions in real analysis

Can anyone help me with this?

Spose $I$ is a closed interval from $0$ to $1$ and let $f$ go from $I$ to $R$ be defined by $f(x) = x$ for $x$ rational, and $f(x) = 1-x$ for $x$ irrational. Show that $f$ is injective on $I$ and that $f(f(x)) = x$ for all $x \in I$. Show that $f$ is cont. only at the point $x = 1/2$

-

1
It's strange how "Show that $f$ is injective on $I$" is before "$f(f(x))=x$", considering the former follows from the latter. – wj32 Nov 2 '12 at 2:56

## 1 Answer

First note that $x$ and $f(x)$ are either both simultaneously rational or simultaneously irrational.

To prove that it is injective, let $f(x_1) = f(x_2)$. Then $f(x_1)$ and $f(x_2)$ are both rational or both irrational. Hence, either $x_1 = x_2$ or $1-x_1 = 1-x_2$. Both imply that $x_1 = x_2$.

Hence, $f(x)$ is injective.

If $x$ is rational, then $f(f(x)) = f(x) = x$.

If $x$ is irrational, then $f(f(x)) = f(\underbrace{1-x}_{\text{irrational}}) = 1-(1-x) = x$.

To show that $f$ is not continuous for all $x \neq \dfrac12$, approach $x$ by a sequence of rationals to get a limit of $x$ and a sequence of irrationals to get a limit of $1-x$.

For instance, if $x \neq \dfrac12$ is rational, consider the sequence $x_n = x-\dfrac{x}{n\sqrt{2}}$, to get $$\lim_{n \to \infty} f(x_n) = 1-x \neq x = f(x)$$

For instance, if $x \neq \dfrac12$ is irrational, consider the sequence $x_n = \dfrac{\lfloor 10^n x\rfloor}{10^n}$, to get $$\lim_{n \to \infty} f(x_n) = x \neq 1-x = f(x)$$

To show that $f$ is continuous at $x = \dfrac12$. Note that $\vert f(1/2+h) - f(1/2) \vert = h$, irrespective of $h$ being rational or irrational.

-
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 45, "mathjax_display_tex": 2, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.3, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "github"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "english_confidence": 0.9603086709976196, "perplexity_flag": "head"}