In one of the first chapters in my class about mathematical analysis we learned about continuity, but when we talked about continuity in sets i found something that is in my opinion kinda weird.
Suppose that $f$ is a function with domain $\mathcal{D}$, then $f$ is continuous in (or over) a set $A \subseteq \mathcal{D}$ if the restriction $f/A$ is continuous in every point:
\begin{equation} \lim\limits_{t\to x,t\in A} f(t) = f(x), \hspace{1cm} \forall x\in A \end{equation} or also if:
\begin{equation} (\forall x \in A)(\forall \varepsilon > 0)(\exists\delta >0)(\forall t \in A)(|t-x|<\delta \Longrightarrow |f(t)-f(x)|< \varepsilon) \end{equation}
And this is all well and good but under the definition in a note they say: This formula doesn't express that $f$ is continuous in every point of $A$ because the formula for that is:
\begin{equation} (\forall x \in A)(\forall \varepsilon > 0)(\exists\delta >0)(\forall t \in \mathcal{D})(|t-x|<\delta \Longrightarrow |f(t)-f(x)|< \varepsilon) \end{equation}
And also analogous, '$f$ is continuous in $A$' isn't equal to:
\begin{equation} \lim\limits_{t\to x} f(t) = f(x), \hspace{1cm} \forall x\in A \end{equation}
The difference between both formula is that in the $4^{th}$ pair of brackets the set $A$ is replaced with the domain $\mathcal{D}$. But i can't quite wrap my head around that. I don't quite get what the difference actually is and how this difference expresses itself.
Would someone be able to explain it, maybe even with an example?
Here's an example: consider the map$$\begin{array}{rccc}f\colon&\mathbb R&\longrightarrow&\mathbb R\\&x&\mapsto&\begin{cases}1&\text{ if }x\in\mathbb Q\\0&\text{ otherwise.}\end{cases}\end{array}$$Then $f$ is discontinuous at every point of its domain. However, $f|_{\mathbb Q}$ is continuous.