It's hard for me to formulate this into a specific question, so I'll split this into two sub-questions that will hopefully explain my confusion.
Say I have the function $\frac{x}{x}$. As far as my understanding goes, this guy is discontinuous at $x=0$, but is continuous at any other point on the real line (with both limits & function values being $1$); the limit is $1$ at $x=0$ as well, but the function's value is not (nor is it anything, seeing as it is not defined there), which is why it's not continuous at that point.
Assuming the above is true, I can look at $\frac{x}{x}$ as the product of, for instance, $f(x)=x$ and $g(x)=x^{-1}$, and say that it is discontinuous at $x=0$ simply because the domain of $g$ (and therefore, the domain of the product) does not include $0$.
A discussion I was reading seemed to conclude that, for a function $g(x)$ discontinuous at point $a$ and a continuous function $f(x)$, the product $f(x) \cdot g(x)$ is discontinuous at $a$ if neither $f(x)$ nor $g(x)$ are $0$, but is continuous $\forall x \in \mathbb{R}$ (incl. a) if, e.g, $f(x)=0$ for all $x \in R$. Though, to my understanding, this is only true if the discontinuity isn't caused by a point in which either function is undefined. For example, if $f(x)=0$ and $g(x)=\frac{1}{x}$, then it would still be wrong of me to say that $f(x) \cdot g(x)$ is continuous at $0$, because $0$ should be out of its domain. Is this right?
And for the second part of the question: I initially began this question with "Say I have the function $\frac{x}{x}$ over $\mathbb{R}$", but then felt extremely unsure about whether I could even say that, seeing as it is not defined at $x=0$ and a function needs to be defined over the entirety of its own domain. In the case of the function mentioned above, the domain must therefore not include $0$, so it could, for example, be $\mathbb{R} \setminus \{0\}$. But then this raises another question: I saw a mention of the Dirichlet function being continuous over the rationals; but if this is the case then continuity is domain-dependent, and so if I define $\frac{x}{x}$ over $\mathbb{R} \setminus \{0\}$, then it is continuous.
I can tell there's a difference here: the function is continuous over the entirety of its own domain; but it then gets a bit more confusing when I have a product of two different functions with different domains.
Please help me understand the relationship between domain & continuity, and/or point out any inconsistencies in my understanding described above.