I’ve heard and read in many books that the function
$$\sin\left(\frac{1}{x}\right)$$
is discontinuous at $x=0$ since as $x$ tends to zero the function ‘oscillates’ rapidly that is , for numbers very close to each other the number takes valued such as $-1$ and $1$ hence we cannot define a limit. But I’ve also read that the continuity of a function is defined only over its domain. Then why do we define the continuity of $\sin(\frac{1}{x})$ if $x=0$ does not lie in its domain ?