What's the difference between "in" and "on"?

This may be just a grammatical question.

I have seen the following two representations:

1. This function is continuous in $$D.$$
2. This function is continuous on $$D.$$

Is there any difference between them? I thought that "in $$D$$" means the inside of $$D$$ while "on $$D$$" contains its boundary, but I have faced many exceptions.

Could anyone explain the difference? I would appreciate if you could tell me other cases where this kind of difference matters.

• They have the same meaning. Your interpretations of "in $D$" and "on $D$" are not common. You will encounter almost as many ambiguities in the use of English to discuss mathematics as you encounter in many languages to discuss many topics, way, way too many to discuss here. Jul 5, 2019 at 15:12
• Some context would help. What is $D$? At the moment, the only usage of "continuous in" that I can think of is "continuous in the first variable" and suchlike, which can't be what you are talking about. As for "continuous on," I don't think the boundary is included. "Continuous on the open unit disk" certainly doesn't imply continuity on the closed unit disk. Jul 5, 2019 at 15:15
• They are both the same. One usually uses one in literature etc. depending on what $D$ is. It is more natural to say 'on the surface of a sphere' rather than 'in the surface of a sphere', whereas they both mean $\in \partial S^2$ Jul 5, 2019 at 15:16
• Sorry for my ambiguity. I intended to refer to sets, not variables. Jul 5, 2019 at 15:19
• For sets $D$, the correct phrasing is "continuous on $D$". I've also seen "in" used in such contexts, but it's generally the result of translation from some foreign language. Jul 5, 2019 at 18:55

Consider the function $$f: \mathbb R \to \mathbb R$$ defined by $$f(x)=1$$ for $$x \in [0,1]$$ and $$f(x)=0$$ for $$x \in \mathbb R -[0,1]$$. The function is not continuous but the restriction $$f:[0,1] \to \mathbb R$$ is just the constant function so is continuous. For the subset of the domain $$D=[0,1]$$ we say $$f$$ is continuous on $$D$$.
Consider the function $$f(C,D) = \lfloor C \rfloor + D$$ of variables $$C$$ and $$D$$. The function is not continuous but for each fixed $$C_0$$ the function $$D \mapsto f(C_0,D) = \lfloor C_0 \rfloor + D\$$is continuous. In this case we say $$f$$ is continuous in $$D$$.
I have never seen these terms referring to the boundary. More common terms are continuous on $$\boldsymbol D$$ or continuous on the interior of $$\boldsymbol D$$. Another common thing to say is differentiable/holomorphic on the interior of $$\boldsymbol D$$ and continuous on the boundary.