In Steven Lay's "Analysis with an Introduction to Proof" (4th ed), the following two definitions are given:
Let $D$ be a nonempty subset of $\mathbb{R}$, $S$ be a nonempty subset of $D$, $f:D\to \mathbb{R}$, and $c\in D$. We say that "$f$ is continuous at $c$" if $$\forall \epsilon>0,\exists \delta>0,\forall x\in D,\mid x-c\mid<\delta\implies \mid f(x)-f(a)\mid<\epsilon,$$and we say that "$f$ is continuous on $S$" if $f$ is continuous at every point in $S$.
My confusion is about the second definiton, continuity on a subset of the domain. To show where I am confused I will give a concrete example. Let $f:\mathbb{R}\to \mathbb{R}$ be the function defined as below: $$f=\begin{cases} 0,& x<1 \\ 1,& x\geq 1 \end{cases}$$and let us consider the continuity of $f$ on the interval $[1,2]$.
Clearly, $f$ is discontinuous at $1$, and so since $1\in[1,2]$, we have by our above definition of continuity on a set that $f$ is not continuous on $[1,2]$.
Ok, the first problem I have is this: We want our formal, mathematical definiton of continuity on a set to encapsulate our informal, intuitive definition of continuity on a set, which is "to be able to draw the function without picking our pencil up". Well, we can definitely draw $f$ on $[1,2]$ without picking our pencil up, so unless we want our formal definition to disagree with our intuition that $f$ should be continuous on $[1,2]$, we have a problem.
The second problem I have is this: Wikipedia defines continuity on specifc types of subsets of the domain, and in particular Wikipedia's definition for continuity on a closed interval says that, in contrast to the conclusion we reached in the above example, $f$ is continuous on the interval $[1,2]$. Here is the definition I am referring to from Wikipedia:
A function is continuous on a closed interval if the interval is contained in the domain of the function, the function is continuous at every interior point of the interval, and the value of the function at each endpoint that belongs to the interval is the limit of the values of the function when the variable tends to the endpoint from the interior of the interval.
So we cannot have both Lay's definition and Wikepedia's definition be correct. Because of the first problem I mentioned above that I have, I am leaning towards saying that Lay's definition is incorrect. This is my first question:
Q1: Is Lay's definition of continuity on a subset of the domain incorrect?
Ok, but I also have a second question. I skimmed the wikipedia page that I pulled the above definition from, but I could not find a definition of continuity on an arbitrary subset of the domain, not just intervals that are subsets of the domain. I also couldn't find such a definition in any of my textbooks other than the one provided by Lay (which I think may be incorrect).
So I wanted to write what I think the definition of continuity on an arbitrary subset of the domain should be, and then hopefully someone can tell me whether or not it is wrong. And if it is wrong, I would greatly appreciate someone telling me the correct definition. Here is my provisional definition:
Let $D$ be a nonempty subset of $\mathbb{R}$, $S$ be a nonempty subset of $D$, $f:D\to \mathbb{R}$, and $c\in D$. We say that "$f$ is continuous on $S$" if the restriction of $f$ to $S$, $f\mid_{S}$ is continuous at every point in its domain (which is $S$).
Again, my second question is:
Q2: Is my above definition correct? If not, what is the correct definition?
Would greatly appreciate any help here! Thank you!
There is not necessarily a "correct" definition: Mathematics has no central authority, and different authors may use the same word or phrase to mean different things. But I think the Wikipedia definition is the most common: a function $f$ is said to be continuous on a subset $S$ of its domain if its restriction to $S$ is continuous. If I wanted to say that $f$ was continuous at every point of $S$ I would say "continuous at every point of $S$" rather than "continuous on $S$".