In Andrey Gogolev's answer the following two assertions appear:

"It is clear that $X$ is a non-empty . . . set" and "Now consider any maximal interval
$(c,e) \subset ((a,b) - X)$. Recall that $f$ is a polynomial of some degree $d$ on
$(c,e)$."

These are true, but perhaps not transparently obvious. In attempting to fill the gaps, I
developed a variation of the proof which requires neither the observation that $X$ has no
isolated points nor any argument about degrees of polynomials. Here is my adaptation,
borrowed freely from Gogolev:

I use the symbol "$\bot$" for "contradiction."

Define $I = [0,1]$ and $X = \{x \in I: \forall (a,b) \ni x: f|_{(a,b) \cap I} \; is \;
not \; a \; polynomial\}$ .

We first establish the following:

Lemma: Suppose $[c,d] \subset I$ is an interval on which $f$ coincides with a polynomial
$p$. Then there exists a maximal subinterval $[cm,dm]$ having the properties $[c,d]
\subset [cm,dm] \subset I$ and $f = p$ on $[cm,dm]$. Furthermore, $cm \in X \cup \{0\}$
and $dm \in X \cup \{1\}$.

Proof: Let $cm$ = LUB $\{x: f(x) \neq p(x)\} \cup \{0\}$ and $dm$ = GLB $\{x: f(x)
\neq p(x)\} \cup \{1\}$. It is clear that $[cm,dm]$ is maximal. Supppose that $cm
\not \in X$ and $cm \neq 0$. Then we can find another interval $(u,v)$ with $cm \in (u,v)
\subset I$ on which $f$ coincides with a polynomial $q$. But on $[cm,v]$ we have $f = p =
q$, whence $f = p$ on $[u,dm]$. Since $u < cm$, we see that $[cm,dm]$ is not maximal
($\bot$). Therefore, $cm \in X$ or $cm = 0$. Likewise, $dm \in X$ or $dm = 1$.

Now we begin the proof-by-$\bot$ of the main result. Suppose that $f$ is not a polynomial
on $I$.

If $X = \emptyset$, we begin with any $[c,d]$, and the lemma tells us that $cm = 0$ and
$dm = 1$, so $f$ is a polynomial on $I$ ($\bot$). Thus, $X \neq \emptyset$. Now define
$S_n = \{x: f^{(n)}(x) = 0\}$. $X$ and $S_n$ are clearly closed. Applying the Baire
category theorem to the covering $\{X \cap S_n\}$ of the complete metric space $X$, we get
that there exists an interval $(a,b)$ such that $(a,b) \cap X \neq \emptyset$ and $(a,b)
\cap X \subset S_n$ for some $n$. (It is important here that $S_n$ is closed.)

Put $J = (a,b) \cap I$, and let $a1$ and $b1$ be the left and right end-points of $J$.
(Observe that it is possible that $a1 = 0$ or $b1 = 1$, so J may not be open.) If $J
\subset S_n$, then $f$ is a polynomial on $J$, whence $(a,b) \cap X = (a,b) \cap I \cap X
= J \cap X = \emptyset$ ($\bot$). Thus, we can choose a point $t \in J - S_n$. Now $t
\not \in X$, since $(a,b) \cap X \subset S_n$. Therefore, we can find an interval $(c,d)
\ni t$ such that $f$ coincides with a polynomial $p$ on $(c,d) \cap I$. Furthermore, $f =
p$ on the closure of $(c,d) \cap I$, which is an interval of the form $[c1,d1] \subset I$.
Apply the lemma to $[c1,d1]$ to obtain a maximal interval $[cm,dm]$ having the stated
properties. Since $t \not \in S_n$ and considering $p$, we see that $cm \not \in S_n$.
Suppose $cm > a1$. Then we have $a \le a1 < cm \le c1 \le t < b$, so $cm \in (a,b)$.
From the lemma, $cm \in X$, since $cm > a1 \ge 0$. Thus, $cm \in (a,b) \cap X \subset
S_n$ ($\bot$). Therefore, $cm \le a1$. Likewise, $dm \ge b1$. Thus, $f$ is a polynomial
on $J \subset [a1,b1] \subset [cm,dm]$, whence, as above, $(a,b) \cap X = \emptyset$
($\bot$). We are at last forced to conclude that $f$ must indeed be a polynomial on $I$.

4

Also asked here: http://mathoverflow.net/questions/64246/

– S. Carnahan – 2011-05-08T01:58:18.690in cooking up my own solution to this classic problem which I've already encountered elsewhere, I came to wonder wether there are any closed, denumerable sets of reals that have no isolated points... Anyone know the answer to this? – Olivier Bégassat – 2011-05-08T04:56:24.140

nevermind, I think I have one. – Olivier Bégassat – 2011-05-08T04:59:25.990

2

Olivier: you are referring to the notion of "perfect set", and there are no nonempty countable perfect sets. The argument is essentially a Baire category argument. See http://pirate.shu.edu/~wachsmut/ira/topo/proofs/pfctuncb.html

– Todd Trimble – 2011-06-12T14:51:33.430I don't understand as to why this question was voted $\text{off-topic}.$ – crskhr – 2011-07-31T07:08:48.543

4This is stated as an exercise in Rudin's "Principles", and yes, it gets assigned as freshman's homework (at least where I come from). Originally it was formulated and solved in 1930's by Banach, if I remember correctly. I will try to dig up a more precise reference. – Margaret Friedland – 2011-11-01T13:59:42.967

@Margaret: Thanks, I would like to know the history of this problem as well. I will be thankful if you could provide me with the history. – crskhr – 2011-11-01T17:03:16.773

Chandrasekhar: why have you now changed the question to read $f^n$ instead of $f^{(n)}$? These mean different things – Yemon Choi – 2011-11-01T20:08:12.500

@yemon: OK, i fixed it back. I thought both mean the same. – crskhr – 2011-11-02T07:58:22.107

Margaret, I looked through Rudin's Principles of Mathematical Analysis (3rd edition) but didn't find this exercise. What page is it on? Also, where do you come from (that this exercise is assigned to freshmen)? – Todd Trimble – 2012-03-28T17:55:48.287

1My memory failed me on this problem. The only thing I am now sure about is that it was assigned as a freshman homework when I was a student at Jagiellonian U. in Krakow, Poland, a little more than 20 years ago (no, I did not solve it then). Rudin was used as a supplementary text, but I must have seen it printed somewhere else (or was it added in the Polish translation?). Proving various properties of function spaces via Baire category was a Polish specialty in 1930's, but, as indicated by @juan, this particular theorem apparently has different origin. Sorry for the confusion. – Margaret Friedland – 2012-07-05T16:55:10.953

@TheMathemagician It's not too far away from a homework for first year calculus or analysis, which doesn't mean that it's easy, but only that it could be written in elementary language within a considerable length. In my university, the fact is the derivative of a differentiable function is continuous at a point, is left as a homework exercise, which is also, in fact, a consequence of Baire's category theorem. – Frank Science – 2016-02-19T09:28:15.123

@FrankScience, I suppose that one can derive any true statement from anything, but is there a sense other than this formal one in which the continuity of a differentiable function is a consequence of Baire's category theorem? – LSpice – 2017-08-11T01:55:21.233

@S.Carnahan, the question you reference gives the stronger hypothesis suggested by @ZenHarper. – LSpice – 2017-08-11T01:56:54.473

1@LSpice I don't know whether I misunderstood your response. What I said is that, given a differentiable function (on $\mathbb R$, say) $f$, then the derivative $f'$ (not $f$) should be continuous at some point $x_0\in\mathbb R$. I don't think that it's tautological. – Frank Science – 2017-08-11T06:53:33.920

@FrankScience, no, I misunderstood you, not the other way around. I misread it as the totally elementary statement "a differentiable function is continuous." Sorry! – LSpice – 2017-08-11T14:39:43.787

6This seems like a homework problem in a 1st year course on calculus. – Ryan Budney – 2010-07-31T21:51:57.457

11This is a jewel, I will try to recall the solution. – Andrey Gogolev – 2010-07-31T22:05:56.740

Chandru, my suspicion is that instead of "for each $x \in [0,1]$, there is an integer $n \in \mathbb{N}$, it said there is an integer $n \in \mathbb{N}$ such that for each $x \in [0,1]$. – Michael Hardy – 2010-07-31T22:34:29.803

......OK, maybe this is subtler than I thought........ – Michael Hardy – 2010-07-31T22:38:41.043

14@Ryn: no, this is a classic little problem. @Michael: the problem is correct as stated. – Qiaochu Yuan – 2010-07-31T22:39:54.317

7This is basically a double-starred exercise in the book "Linear Analysis" by Bela Bollobas (second edition), and presumably uses the Baire Category Theorem. Since it is double-starred, it is probably very hard!! Solutions are not given, and even single starred questions in that book can be close to research level.

However, the version in that book has $f$ on the whole real line, and $f^{(m)}(x) = 0$ for ALL $m>n$.

So are you sure your question is correct, since it's assuming a lot less but coming to roughly the same conclusion? – Zen Harper – 2010-07-31T23:32:09.500

4In view of Ryan's and Zen's comments, can the author, please, indicate the origin of the question? – Victor Protsak – 2010-07-31T23:52:14.157

Like Zen, I have seen a version of this question before set as an "exercise" - the tricky part, which I never solved on my own, is what to do once you've done the "obvious" Baire category part. Here I say "obvious" in the context of it being one of several BaireCat flavoured exercises in a batch, not "so obvious that everyone should have thought of it" – Yemon Choi – 2010-08-01T01:06:23.063

73@Ryan "This seems like a homework problem in a 1st year course on calculus." If you can find a regularly offered calculus course at more then 4 universities in the world that have the same number of students in the class who have even a clue how to solve this problem,I'll sing the American National Anthem naked on YouTube.I'm dead serious. – The Mathemagician – 2010-08-01T02:59:31.487

8Better be serious than dead. By the way, does desecrating the anthem carry the same consequences as burning the flag? – Victor Protsak – 2010-08-01T05:02:24.033

18I agree with Andrew L.'s opinion(but not the more extreme part of it). If such hard questions are given as homework for a first year calculus course, then there will be complaints about the instructor, and indeed about the department. It is my modest contention that anyone who criticizes a question as homework should be able to substantiate it by giving a short solution in the comments. This doesn't take much effort. What I am preaching is just a variant of "All right, but let the one who has never sinned throw the first stone!". Before closing a question as homework, first solve it. – Anweshi – 2010-08-01T13:16:10.177

@Qiaochu, You're quite right; I was hasty. – Michael Hardy – 2010-08-01T17:39:56.093