I'm using Michael Spivak's Calculus, 3rd edition textbook. Without ado, I'll state the definition given for continuity at a point:
DEFINITION$\;\;\;\;$The function $f$ is continuous at $a$ if: $$\lim_{x\to a}f(x) = f(a)$$
And I might as well give the definition for the limit at a point:
DEFINITION$\;\;\;\;$The function $f$ approaches the limit $l$ near $a$ means: for every $\epsilon>0$ there is some $\delta>0$ such that, for all $x$, if $0<|x-a|<\delta$, then $|f(x)-l|<\epsilon$.
It is clear, then, that in order to verify whether a function is continuous at a point $a$, we need to compute $f(a)$, and this is only possible if $a$ is in the domain of $f$. So, what happens when a point $a$ is not in the domain of $f$?
On this matter, I've had some people telling me that statements about continuity only make for points in the domain of $f$. Spivak himself also mentions in the Continuity chapter of his textbook that "We also often simply say that a function is continuous if it is continuous at $x$ for all $x$ in its domain."
But that means functions like $f(x) = \frac{1}{x}$, $f(x) = \frac{1}{x^2-1}$ and $f(x) = \sin{\frac{1}{x}}$ can all be said to be continuous. It just doesn't seem right, in fact I always thought these were textbook examples of discontinuous functions. It also means that we can't say that $f(x) = \frac{1}{x}$ is discontinuous at $0$, because we don't even know the value of $f(0)$ in order to decide whether it's continuous or not.
Are all of these conclusions correct, or did I misinterpret the definitions? I'd love if someone could shed some light on this, I'm having a hard time wrapping my head around it.
When a function is called continuous, it is often the case that it is continuous on all real numbers. It is reasonable to call a function continuous the set of points where it satisfies the definition of continuity is understood.
Personally, for undergraduate calculus, I prefer to call a function $f:D\rightarrow\mathbb{R}$ (where $D$ is a subset of, or is equal to, $\mathbb{R}$) discontinuous if its graph cannot be drawn with a single penstroke. In which case $f(x)=1/x$ would be called discontinuous. However, $f(x)=1/x$ is definitely continuous on its domain ($x\neq0$). It's not continuous on $\mathbb{R}$ $-$ it's not even defined on all of $\mathbb{R}$.
The examples $f(x)=1/x$ and $g(x)=1/x^2$ are not continuous at $x=0$! They do not satisfy the definition of continuity there, so we call it discontinuous at the origin. Anyone who calls it continuous at the origin is wrong, in general.
However, we can define the extended real numbers: $\overline{\mathbb{R}}=\{-\infty\}\cup \mathbb{R}\cup \{\infty\}$ and define: $$ g(x)=\begin{cases} \frac{1}{x^2} \text{ if } x\neq 0, \pm\infty \\ \infty \text{ if } x = 0 \\ 0 \text{ if } x=\pm\infty, \end{cases} $$ and $g:\overline{\mathbb{R}}\rightarrow \overline{\mathbb{R}}$ can be said to be continuous on the extended reals. Of course, you have to carefully consider how to define continuity in this context.