# A Real valued function which is discontinuous **only** on a given specific set.

Let $\mathbb{L}=\{x_n \ |\ n=1,2,3 \dots\}$ be a countable subset of $\mathbb{R}$.

My aim is to construct a real valued function $f$ on $\mathbb{R}$ such that $f$ is discontinuous at every point from $\mathbb{L}$ and continuous at all the other points.

I don't know how to proceed. Hints will be appreciated.

• I don't see why you would need $\mathbb L$ to be finite. – Surb Sep 17 '14 at 10:00
• A characteristic function won't necessarily work if $L$ is infinite, e.g. $\chi_\mathbb{Q}$. – Josh Keneda Sep 17 '14 at 10:03
• @surb.I do not mean that $L$ is necessarily finite. I think if $L$ is finite then characteristic function on $L$ satisfies the requirement. – yazhini Sep 17 '14 at 10:07
• Here i'm posting two problems.. First one is " how to construct a function which is discontinuous only on $$\mathbb L," where \mathbb L is countably infinite. – yazhini Sep 17 '14 at 10:11 • If L is finite, you're right, you can just take a characteristic function. – Josh Keneda Sep 17 '14 at 10:14 ## 1 Answer As @Josh Keneda points out, a characteristic function won't work in general if L is infinite. But we can use the following slight modification:$$ f(x) := \sum_{n=1}^\infty \frac{1}{n} \cdot \chi_{x_n} (x). 

It is clear that $f$ is discontinuous at every $x_n$, because the set where $f(x) = 0$ is dense.

Below is a proof that $f$ does what you want (first try it yourself).

To see that $f$ is continuous at every $x \notin \{x_n \mid n\}$, let $\varepsilon > 0$ be arbitrary. Choose $\delta > 0$ such that $x_n \in (x-\delta, x+\delta)$ only holds for $n \geq \frac{1}{\varepsilon}$. Hence, $|f(y)| < \varepsilon$ for all $y \in (x-\delta, x+\delta)$.

EDIT: If $L$ is finite, it is clear (as above) that $f = \chi_L$ is discontinuous at every $x = x_n$, because the set where $f = 0$ is dense in $\Bbb{R}$ (it has countable/finite complement).

Conversely, $f = \chi_L$ is continuous at every $x \in \Bbb{R} \setminus L$, because we can take $\delta > 0$ with $(x - \delta, x + \delta) \cap L = \emptyset$ (take $\delta = \min\{ |x - y| \mid y \in L\}/2$), so that $|f(y) - f(x)| = 0 <\varepsilon$ holds for all $y \in (x-\delta, x+\delta)$.

• Replace 1/n by 1/n^2 (or anything summable), otherwise the series defining f(x) may diverge. – Did Sep 17 '14 at 10:20
• This example is similar to Riemann's example (see en.wikipedia.org/wiki/Thomae%27s_function), an example of a function with discontinuity set the rationals. – Orest Bucicovschi Sep 17 '14 at 11:13
• @Did: It's OK, it's enough that the sequence $\frac{1}{n}$ converges to $0$. – Orest Bucicovschi Sep 17 '14 at 11:15
• @Did: We do not even need $\frac{1}{n} \to 0$. Note that $\chi_{x_n} (x)$ is not null only for $x = x_n$. Hence, only (at most) one summand of the series does not vanish for every $x$ (here, I assume $x_n \neq x_m$ for $n\neq m$). So, we could even use $n$ instead of $1/n$, but then $f$ would not necessarily be continuous on $\Bbb{R} \setminus \{x_n \mid n\}$. – PhoemueX Sep 17 '14 at 11:21
• Right, I mistook your chi function at $x_n$ for the indicator function of the set $(-\infty,x_n]$ (don't ask me why I went astray like that...). Sorry for the noise. – Did Sep 17 '14 at 11:54