Limit when both left and right hand sides are undefined? I read here that $$\lim_{x \to 0} \sqrt{x} = 0$$
This is because the function
$$f(x) = \sqrt{x} =
\begin{cases}
      \sqrt{x} & \text{if}\ x \geq 0 \\
      \text{undefined} & \text{otherwise}
    \end{cases}$$
is undefined for negative values of $x$, so the limit can't be taken in the first place. But, what if both left and right sides are undefined?
Consider $$
g(x) = 
    \begin{cases}
      0 & \text{if}\ x = 0 \\
      \text{undefined} & \text{otherwise}
    \end{cases}
$$
What will be $$\lim_{x \to 0} g(x)$$ now?
 A: Foreword:
So, in writing this, my initial thoughts were "sure, it passes $\varepsilon-\delta$, sort of," but this was not an answer that felt very enlightening to me. There did feel something to be "off" about it, even if it works technically.
As I searched a little for thoughts on the matter, it came to me that the reason was really all about "limiting behavior" and how we define it. These naturally tie in to topology and topological spaces, and in looking around I came across a few thoughts.
So as a couple of caveats: I don't claim any of the three below as a "definitive" viewpoint; ultimately I think whichever answer is the most relevant will depend on the definitions you want to use in a given context, but I feel all three take reasonable looks at the matter. A second caveat is that it assumes, perhaps a bit much, familiarity with set theory, analysis, and topology for the levels at which questions like these might arise; even so, I hope you can get something out of the discussion (even if it's just that definitions matter a LOT in math).

A First Glance: $\varepsilon-\delta$:
Well, one way to look at this is from the point of view of the $\newcommand{\ve}{\varepsilon}
\newcommand{\d}{\delta}
\newcommand{\abs}[1]{\left|#1\right|}
\ve-\d$ definition. So, in general,
$$\lim_{x \to c} f(x) = L \iff (\forall \ve >0)(\exists \d > 0) \Big( 0<\abs{x-c} < \d \implies \abs{ f(x) - L } < \ve \Big)$$
So, for $f$ being your $g$, and $L=0$ as our guess, we want to examine the claim
$$(\forall \ve > 0)(\exists \d > 0) \Big( 0<\abs{x} < \d \implies \abs{g(x)} < \ve \Big)$$
Well, in our scenario, $x=0$ only, and $g(x)=0$ correspondingly. But then the presumption $0 < \abs{x} < \d$ never holds and $|g(x)|$ is never defined, so vacuously the claim holds. (Yet it also seems to validate any possible claimed value of the limit, $0$ or otherwise.)
So this means the two-sided limit exists ... sort of.

A Second Look: Limit Points:
This (on an intuitive level, and maybe just to me) contradicts a lot of what we like to think about when it comes to limits and limiting behavior. Can this be salvaged or investigated further? Clearly the definition outlined above doesn't always work for certain subsets of $\mathbb{R}$.
Consider the definition of a "limit point" from, for the sake of argument, topology. It's a bit of a side-journey, inspired by a comment here, but it gets us on our feet for future discussion.

Definition (Limit Point): We consider a set $X$ and a topological space $\tau$ defined upon it. Take $p \in X$ and $S \subseteq X$. We say $p$ is an accumulation point or limit point of $S$ if any (nonempty) open neighborhood of $p$ contains at least one point of $S$ (that is not $p$). Denoting the set of limit points by $S'$, then,
$$p \in S' \iff (\forall U \text{ nonempty open nbh's of } p)( U \setminus \{p\} \cap S \ne \varnothing)$$

In $\mathbb{R}$, the open sets are typically the open intervals $(a,b)$, but a singleton - in $\mathbb{R}$ - is closed. But of course, a set need not use the topology of $\mathbb{R} \newcommand{\R}{\mathbb{R}}$.
In this context, we define a topology as so:

Definition (Topological Space): A collection $\tau$ of subsets of a set $X$ is a topology -- and ($X,\tau$) called a topological space, and the elements of $\tau$ open sets -- if these hold:

*

*$X,\varnothing \in \tau$

*Closure under arbitrary union: $\{A_i\}_{i \in \mathcal{I}} \subseteq \tau \implies \bigcup_{i \in \mathcal{I}} A_i \in \tau$, even if $\mathcal{I}$ is infinite and uncountable.

*Closure under finite intersection: For any $n \in\mathbb{N}$, $\{A_i\}_{i=1}^n \in \tau \implies \bigcap_{i=1}^n A_i \in \tau$

Taking $X := \{0\}$ (the domain of your function $g$) as our topological space, then, we only really have one choice of a topology: $\tau := \{ \{0\},\varnothing\}, \{\varnothing,X\}$.
Now, passing towards the definition of limit points: take $S := X$ in our definition. Is $p := 0$ a limit point? Well, there are two open sets to consider, only one is nonempty, $X$ itself. But $X \setminus \{0\} = \{0\} \setminus \{0\} = \varnothing$, so in this sense $0$ is not a limit point.
So one way to frame the issue is restricting the definition to stuff tied to limit points. That is, one could say it only makes sense claim $\lim_{x \to c} f(x)$ means anything, if $c$ is a limit point of the domain of $f$. (After all, $x$ is approaching $c$, so some sort of approaching behavior should be expected there, no?)

A Third Approach: Shrinkage:
The above idea of a limit point didn't directly touch onto the definition of the limit of a function, so much as general approaching behavior. A limiting point of a set should be something that can be "approached," and we choose to show $p \in S'$ can be approached by members of $S$, by saying that no matter how small a neighborhood is about $p$, members of $S$ are always close  enough by to get "captured" by the neighborhood.
These same ideas lead nicely into a definition of limit of a function given here. Intuitively, we look at a function and shrink about its claimed limit: then if neighborhoods of the limiting value of the input variable map into the limit's neighborhood, it seems reasonable to claim that it is the limit. The smaller the neighborhood around $L$, the smaller (it would feel) the neighborhood around $c$ needs to be to claim $\lim_{x \to c} f(x) = L$, right?
We codify it explicitly:

Definition (Limit of a Function): Let $f : X \to Y$. For shorthand, let $U_x$ denote a generic open neighborhood of $x$ in the domain of $f$, and $V_y$ one of $y$ in the codomain, both nonempty. Then:
$$\lim_{x \to c} f(x) = L \iff (\forall V_L)(\exists U_c)(f(U_c) \subseteq V_L)$$
(Note that multiple such limits may exist, so properly framed, the leftmost expression should be considered a set and $L$ a member thereof.)

Return now to our original problem, of your $g$. Take any open neighborhood $V_0$ of $0$ in $\R$. Trivially, the only open neighborhood of $0$ in $\{0\}$ is $\{0\}$ itself, and $g(\{0\}) = \{0\} \subseteq V_0$, so it immediately follows, in this sense, that $0$ is still a limit.

Summary & Conclusions:
So, what's "right"? Ultimately, it's about how you want to generalize the $\ve-\d$ definition. Maybe you want to tweak it to handle subsets of $\R$ better, or you opt to generalize the definition. The generalization of the $\ve-\d$ definition in $\R$ generalizes eventually into metric spaces and that into the study of topology, losing structure along the way.
Of course, this merits a few ways to frame matters; there is not necessarily any one "right" generalization, and each will likely have their own pros and cons.
But ultimately, the question comes to that of definitions nonetheless. Is the limit what you claim? Yes? No? It's not a question that can be adequately answered without further clarification. But hopefully this proved somewhat enlightening.
