3

I'm looking for a function that is continuous on $\mathbb Z$ and discontinuous on $\mathbb R \setminus \mathbb Z$. I know the function floor of $x$, denoted $\lfloor x \rfloor$, that is continuous at all $c \in \mathbb R \setminus \mathbb Z$ and discontinuous at all $c \in \mathbb Z$. But I'm looking for the opposite one. Thank you.

TheSimpliFire
  • 28,020
  • https://math.stackexchange.com/questions/60050/find-a-function-f-mathbbr-to-mathbbr-that-is-continuous-at-precisely-o - a simple variation of the example given there will have the desired property – shortmanikos Dec 27 '20 at 17:14
  • @shortmanikos This one is for one point. I'm looking for every c ∈ Z – User489587 Dec 27 '20 at 17:24
  • 1
    Do not self-vandalise posts. – TheSimpliFire Dec 27 '20 at 17:39
  • What does self-vandalise mean? (i'll delete this comment as soon as i have an answer) – math Dec 27 '20 at 17:44
  • 1
    Self-vandalize means exactly what it sounds like. You make a post. And then you replace your post with different things so that your post can no longer be read in the intent you originally meant. Don't do that. – fleablood Dec 27 '20 at 18:03
  • 1
    When you replaced your post with " A function That continuous

    But I'm looking for the opposite one. Thank you." That was a vandalization of the post. You made it unreadable.

    – fleablood Dec 27 '20 at 18:05

3 Answers3

7

I think the function $f$ such that :

  • if $x\in \mathbb{R}-\mathbb{Q}, f(x) = 0$
  • if $x\in \mathbb{Q}, f(x) = \sin \pi x$

will work.

math
  • 2,371
3

The general idea for these is to partition $\mathbb R$ into two distinct but dense partitions. The traditional way is $\mathbb Q$ and $\mathbb R \setminus \mathbb Q$ but any other such ways. Then set $f(x)$ to be one thing for $x$ in one partition and $f(x)$ to be something else significantly far away for $x$ in the other partition.

For example if $f(x) = 1$ if $x\in \mathbb Q$ and $f(x)= 0$ if $x \not \in \mathbb Q$. Such a function is clearly continuous nowhere as in any interval $(x-\delta, x + \delta)$ there will be $x_0\in \mathbb Q$ and $x_1\in \mathbb R\setminus \mathbb Q$ so $|f(x)- f(x_1)|+ |f(x)-f(x_0)| \ge |f(x_0) - f(x_1)|=1$ so either $|f(x)-f(x_1)| \ge 12$ or $|f(x) - f(x_1)| \ge \frac 12$ so we can conclude $|f(x) -f(y)| < \epsilon < \frac 12$ for all $y; |x-y| < \delta$ can not be true.

To make this continuous at some points we need $\lim_{x\to a;x \in \mathbb Q} f(x) = \lim_{x\to a; x\not \in \mathbb Q} f(x)$ for the points where we want an $a$ to be a point of continuity.

So for instance $f(x) = x$ if $x\in \mathbb Q$ and $f(x) =0$ if $x \not \in \mathbb Q$ (or vice versa) is continuous at $x = 0$ and discontinuous every else.

To make it continuous at all integers but nowhere else we can do:

$f(x) = 0$ if $x$ is irrational. But $f(x)=0$ and $x \in \mathbb Z$ and $f(x)\ne 0$ for $x \in \mathbb Q\setminus \mathbb Z$ but $\lim_{x\to n; x\in \mathbb Q} f(x)= 0$ for all $n\in \mathbb Z$ that will be continuous at all integers.

Such an $f(x)_{x\in \mathbb Q}$ could be $f(x)= $ distance to nearest integer $= \min(x-\lfloor x\rfloor x, \lceil x\rceil - x)$.

So that will do it:

$f(x) = \begin{cases}0& x\not \in \mathbb Q\\\min(x-\lfloor x\rfloor x, \lceil x\rceil - x)&x\in \mathbb Q\end{cases}$.

It's continuous at $n\in\mathbb Z$ as $\lim_{x\to n} f(x) = \lim_{x\to n;x\in \mathbb Q} f(x)=\lim_{x\to n;x\not \in \mathbb Q} f(x)=f(n) = 0$.

But for any $a\not \in \mathbb Z$ we have $\lim_{x\to a;x\in \mathbb Q} \min(a-\lfloor a\rfloor a, \lceil a\rceil - a)\ne 0$ but $\lim_{x\to a;x\not\in \mathbb Q}f(x) = 0$.

=== Old function that turns out to be continuous on irrationals ====

$f(x)=\begin{cases} 0 & x\not \in \mathbb Q\\ 0& x\in \mathbb Z\\\frac 1b& x\in \mathbb Q\setminus \mathbb Z;x = \frac ab, a\in \mathbb Z; b\in \mathbb N; \gcd(a,b) = 1\end{cases}$

fleablood
  • 130,341
  • How to prove this function is discontinuous on irrationals? – FormulaWriter Dec 27 '20 at 18:27
  • Actually, I think it is continuous on irrationals. But we can probably tweak it. Let $f(x) = \min ({x}, 1-{x}$..... Oh, wait. $f(x) = 0$ if $x$ is irrational and $f(x)$ equal the fractional part of $x$ or $1$ minus the fractional part, which ever is smallest. – fleablood Dec 27 '20 at 19:38
2

\begin{aligned} f(x)=\frac{1}{2}\left(l(x)+r(x)-|l(x)-r(x)| \right), \end{aligned}

where

\begin{aligned} l(x)=\begin{cases}\lceil x \rceil-x & \text{if }x\in\mathbb{Q}\\ 0 & \text{if }x\notin\mathbb{Q}\end{cases} \end{aligned}

and

\begin{aligned} r(x)=\begin{cases}x-\lfloor x \rfloor & \text{if }x\in\mathbb{Q}\\ 0 & \text{if }x\notin\mathbb{Q}\end{cases} \end{aligned}

M A Pelto
  • 4,788