2

Is it possible for there to be a function $f:{\Bbb R} \rightarrow {\Bbb R}$ defined on some interval $(-\epsilon, \epsilon)$ for some $\epsilon \gt 0$ which is:

  • continuous only at 0
  • differentiable only at 0

If so, what would be the criteria for this? Or, is it required that for the derivative to exist at a point, the function must be continuous on some positive length interval containing that point?

Edit: Is there example of such function that doesn't make use of sets like "the rationals" or "the irrationals" in its definition?

Edit 2: What about some expression in x that only makes use of +,-,*,/, exponentiation, limits and infinite sequences. And, let's say you generate a sequence of such functions $f_1(x), f_2(x), ...$. Can you find such a sequence of functions such that the limiting function is continuous and differentiable only at zero?

  • 1
    Consider $$ f(x) = \begin{cases} x &\text{ if } x \in \mathbb{Q}\ -x &\text{ if } x \notin \mathbb{Q} \end{cases}$$ Show that it's differentiable at $x = 0$ (and hence continuous). – AlkaKadri Oct 08 '18 at 21:52
  • 1
    Lets say function f(x) is such, for rationals equals 0, for irrationals equals x^2. Clearly f is continuous at 0 ( and only at 0). Now taking a look at lim as h tends to 0 (f(h)-f(0))/h = f(h)/h. It either is 0 if we pass through rational h, or have value of h if we pass through irrational h ( which tends to 0). Showing f isn't differentiable at any point p=/=0 isn't that hard – Presage Oct 08 '18 at 21:55
  • 2
    You can't avoid using sets like the rationals. The nature of continuity means you will have to deal with dense sets. – Sambo Oct 08 '18 at 22:17
  • @Sambo interesting. Can you give me a hint where I could find a proof? I was thinking there might be such a function that would be defined as a limiting sequence of a closed-form expression. – Henry Bigelow Oct 08 '18 at 22:28
  • Oh, maybe a limiting sequence could work. I'm not sure what kind of closed-form expression you're looking for, though; the indicator function of the rationals is pretty closed-form to me. – Sambo Oct 09 '18 at 02:23
  • 1
    As for a proof, I don't have a proof for what I said because it isn't really an exact statement... What I can say is that if you want your function to be discontinuous everywhere except for 0, then for every $x\neq 0$, there's some natural number $N$ such that for every $\delta>0$, there's some $y \in (x-\delta, x+\delta)$ such that $|f(x)-f(y)|>1/N$. If you collect all such points, you end up with a dense set. – Sambo Oct 09 '18 at 02:28
  • 1
    Also, @AlkaKadri, I think your function should be with $x^2$ and not $x$. – Sambo Oct 09 '18 at 02:29
  • Hi @Sambo, thanks for the insight. I clarified my question - would be interested to hear your thoughts! – Henry Bigelow Oct 09 '18 at 23:23

1 Answers1

1

TL;DR: The answer is yes IF the functions $f_n$ below can be shown to converge pointwise to the function $f$ below.

First, we want to show that we can express all continuous functions on the real line in this way. If you're okay with using piecewise linear functions, then you can skip this part.

Let $f$ be continuous on $\mathbb{R}$. Then for every $n \in \mathbb{N}$, the Weierstrass Approximation theorem tells us that there is a polynomial $p_n$ such that:

$$ \sup \limits_{x \in [-n,n]} |f(x)-p_n(x)| < \frac{1}{n} $$

In particular, we have that the sequence $(p_n)_n$ converges pointwise to $f$ on $\mathbb{R}$. Indeed, if we take some $x \in \mathbb{R}$, we can find some $N \in \mathbb{N}$ such that $x \in [-N,N]$. Then for every $n \geq N$, we have $|f(x) - p_n(x)| < \frac{1}{n}$, so we get the convergence. Hence we can express any continuous function as the pointwise limit of a sequence of polynomials, which are expressed using only exponentiation, multiplication, and addition.

Now, we want to use continuous functions to approximate pointwise the following function:

$$ f(x) = \left\{ \begin{matrix} x^2 && \text{if } x \in \mathbb{Q} \\ 0 && \text{if } x \notin \mathbb{Q} \end{matrix} \right. $$ To do so, take an enumeration $(q_n)_n$ of the non-zero rationals (this can be done with a closed form expression). Define the functions $g$ and $g_n$ in the following way: $$ g(x) = \left\{ \begin{matrix} 1+x && \text{if } -1 \leq x \leq 0 \\ 1-x && \text{if } 0 \leq x \leq 1 \\ 0 && \text{otherwise} \end{matrix} \right. $$ Note that $g$ is a spike of height 1, centered at $x=0$, and of "radius" 1. $$ g_n(x) = (q_n)^2 * g\left( \frac{x-q_n}{(q_n)^2} \right) $$ Then $g_n$ is a spike of height $(q_n)^2$, centered at $q_n$, and of "radius" 1.

Finally, define $f_n$ as: $$ f_n(x) = \sum \limits_{k=1}^n g_k \left(\frac{x}{10n^3}\right) $$ So, $f_n$ has spikes at the first $n$ rationals, of height $(q_n)^2$, and of rapidly shrinking "radius". I'm not entirely sure, but I think this should converge to the function $f$ described above. Given that the sequence of rationals is given in closed form, and all the other functions are simple operations in terms of the piecewise linear (and continuous) function $g$, this attains the goal.

Of course, the pointwise convergence of $f_n$ to $f$ has to be checked, but it's late here.

Sambo
  • 6,243
  • This seems like overkill. All you actually need is to show $f(x)$ is differentiable at $0$ and not continuous at any other point. I think you can do this directly from the definitions. – David K Oct 10 '18 at 03:53
  • @DavidK See edit 2 in the question - the asker wants a sort of closed form expression – Sambo Oct 10 '18 at 12:33
  • 1
    I see the issue now. OP is making things difficult by rejecting the easy answers, for reasons I do not fully understand. Notice that even in this answer we have an enumeration over the rationals in order to define the desired sequence of functions. – David K Oct 10 '18 at 12:41
  • @DavidK Well, more broadly, I'm trying to gain a more intuitive understanding of continuity and differentiability. My current intuition of both of these concepts is that they are only meaningful as properties of a function in an interval of its domain, rather than a single point. So, the question above is an attempt to find some example to bridge the intuition gap. – Henry Bigelow Oct 11 '18 at 21:21
  • @HenryBigelow I believe there are definitions that match your intuition. For example, there is a definition of strict differentiability that exists only on neighborhoods, never only at a single point. But the standard definition allows weird things to happen that destroy the differentiability of a function everywhere except at one point. You have to be willing to consider weird functions in order to see this. The examples such as $x^2$ at all rational points and $0$ elsewhere are among the least weird examples. – David K Oct 11 '18 at 21:31
  • @DavidK If I understand correctly, my intuition that continuity is a property that occurs on an interval is wrong. So, I'm not looking for a definition that matches my intuition. I'm looking to update my intuition so that it matches the actual definition of continuity. (And, likewise for differentiation). But, you mention "a definition of differentiability that exists on neighborhoods" - can you give me a pointer to that definition? I'd be interested to read about it. – Henry Bigelow Oct 11 '18 at 21:44
  • @HenryBigelow I was thinking of strong derivatives, as described in https://math.stackexchange.com/questions/1675246/differences-between-derivatives-and-strong-derivatives – David K Oct 11 '18 at 21:52
  • @DavidK Thanks very much. I was not aware there were different definitions of continuity and differentiability. I'll study up on that. – Henry Bigelow Oct 12 '18 at 16:56