I've recently started learning about topology, and I was able to prove that any function which is undefined on a countable subset of $\mathbb R$ is also not continuous. However, I am struggling to prove the same claim for a function which is undefined on an uncountable subset of $\mathbb R$. Here's my proof for the countable case:
Denote the set of points upon which $f$ is undefined as $A$. Then, the preimage of the empty set is $f^{-1}(\emptyset) = A$. If $f$ is continuous, then $A$ should be open (as $\emptyset$ is open). However, the singleton set is not open with respect to the usual topology over $\mathbb R$, and since $A$ is a countable union of singleton sets it must also not be open. Hence, the preimage of an open set is not necessarily open, meaning $f$ is not continuous over $\mathbb R$.
This proof breaks down for me, because if $A$ is uncountable it can possibly be open. Taking the function defined by $f(x) = \exp\Big(-\frac{1}{\sqrt{x^2-1}}\Big)$ as an example, the corresponding set $A$ for this $f$ is $A = (-1, 1)$. In this case, $f^{-1}(\emptyset) = (-1, 1)$ is open, so that means $f$ does take open sets to open sets... and so $f$ is continuous.
Can anyone please explain the flaw in my logic?