Why doesn't limit of a double/multivariable function needn't exist given that it exists along all straight line? I am studying multivariable calculus as of now. I have been told by my mentor that if limit exists along all straight lines, it doesn't mean that limit exists. I got the same information from Wikipidea.org as well as Thomas Calculus. However, I doubt this. I think that I have got something (at least for double variable functions), which can be called as a proof.
What I know about limits is that there is a function say $f$ and for calculating limiting value at a point, we evaluate the function for points present in the point's close neighborhood. If all these values are approaching some number, we say that the number being approached is the limiting value.
For example let's say that $f(x, y)$ is a function and we want its limiting value at $(0, 0)$. According to what I have mentioned above about limits, we need to plug in several points in origin's close neighborhood to get the limiting value. If my interpretation of limit is correct, this should give us the correct answer. Let's say I evaluate the limit by approaching origin via lines $y = mx$. I have full control over m and I can manipulate it as I wish. So, by doing this substitution, we can get any $(x, y)$ given both $x$ and $y$ are in close neighborhood of origin by manipulating value of m (Except for x = 0 for which the limiting value can be calculated separately). So, this method is same as the first method mentioned in the paragraph.
But since, from three sources I was getting the same information, I feel that I am wrong. I request to please correct me by telling my mistake.
All the three sources refer the following example as a proof:
Quoting from en.wikipidea.org

A study of limits and continuity in multivariable calculus yields many counterintuitive results not demonstrated by single-variable functions. For example, there are scalar functions of two variables with points in their domain which give different limits when approached along different paths. E.g., the function.
$$f(x,y) = \frac{x^2y}{x^4+y^2}$$
approaches zero whenever the point $(0,0)$ is approached along lines through the origin $({\displaystyle y=kx})$. However, when the origin is approached along a parabola ${\displaystyle y=\pm x^{2}}$, the function value has a limit of ${\displaystyle \pm 1/2}a$. Since taking different paths toward the same point yields different limit values, a general limit does not exist there.

I believe that limit doesn't exists along all lines in this case. Lets say $x_{0}$ is a non-zero x-coordinate of a point in close neighborhood of origin. Let us evaluate limit along a line $y = mx\space where\space m = x_0$. Doing the substitution in the above function, we get,
$$\lim\limits_{x \to 0}\frac{mx^3}{x^4 + m^2x^2}$$
This can be rewritten as $$\lim\limits_{x \to 0}\frac{\frac{m}{x}}{1 + (\frac{m}{x})^2}$$
Out of the several values in close neighborhood of origin, one will $(x_0, y)$. If we plug in this point in our above function with $m=x_0$, for this point, $f$ becomes $\frac{1}{3}$. If I plug in $x = \frac {x_0} {2}$, I get $\frac{2}{5}$. Therefore limit doesn't exists along all the lines.
However, Wikipedia, Thomas Calculus, my mentor all say that limit exists along all lines.
My questions :

*

*Why, if limit exists along all lines, limit needn't exist along every other path.

*What is wrong in my attempt trying to contradict the example given on wikipidea.

Sorry for my poor english. Thank you so much.
 A: A simple example is this:  Let $A$ be the set of all points $(x,y)$ in the plane which satisfy $y\geq x^2$ or $y\leq -x^2$ or $y=0$.  So $A$ is the $x$-axis plus the closed sets inside the two parabolas.
Let $f(x,y) = 1$ if $(x,y)$ is in $A$ and $0$ otherwise.
Near the origin, there are points arbitrarily close to $(0,0)$ for which $f(x,y)=1$ and for which $f(x,y)=0$.  So the limit at $(0,0)$ doesn't exist.
But every line $y=mx$ through $(0,0)$ has to intersect those parabolas.  So the value of $f(x,mx)$ is $1$ when you are near enough to $(0,0)$.  So the limit along any line is $1$.
A: As @groupoid said, the key word is "uniform". For limit to exist, you need existence of directional limits PLUS a uniform speed of convergence in all directions. This can also lead one to the discovery of the parabola counter-example by @B.Goddard also mentioned in the comments.
Note: To add insult to injury, the example of paraboala has all directional derivatives as well, and, the value is linear in the direction variable, as it is zero in all directions. It only further emphasizes the role of uniformity requirement.
A: Consider the function $g_m(x)=f(x,mx)$, for $m\neq 0$.
Applying the definition of limit, fix $\varepsilon>0$ and (for convenience) $\varepsilon < 1/2$, then
$$
|x-0|<|m|\frac{1-\sqrt{1-4\varepsilon^2}}{2\varepsilon}
\qquad\implies\qquad 
|g_m(x)-0|<\varepsilon 
$$
and so
$$
|(x,mx)-(0,0)|<\delta_m=|m|\sqrt{1+m^2}\cdot\frac{1-\sqrt{1-4\varepsilon^2}}{2\varepsilon}
\quad\implies\quad
|f(x,mx)-0|<\varepsilon
$$
If we can find a unique $\delta>0$ such that
$$
|(x,mx)-(0,0)|<\delta\leq\delta_m \quad \implies \quad |f(x,mx)-0|<\varepsilon, \ \forall m\neq0
$$
then the limit exists.
Such a $\delta$ should be smaller than each $\delta_m$, but given that
$$
\inf_{m\neq0}\delta_m=\inf_{m\neq0}\left\{|m|\sqrt{1+m^2}\cdot\frac{1-\sqrt{1-4\varepsilon^2}}{2\varepsilon}\right\}=0
$$
we cannot find such a $\delta$.
A: May be the following picture helps you understand what's going on?

In this countourplot you see the curves where the function $f(x,y)=x^2y/(x^4+y^2)$ takes the same value $s$. The reasonable looking parabolas on the upper half-plane correspond to $s=0.1$, $s=0.2$, $s=0.3$, $s=0.4$ respectively, with the $s=0.1$ parabola being the innermost. The same values of $s$ are repeated on the very wide parabolas above the $x$-axis. Below the $x$-axis the function takes negative values. Darker blue shade means "more negative".
You see, the definition of the limit deals with the values the function takes inside a circular disk near the origin. From the picture we see that this function takes values at least in the range $[-0.4, 0.4]$ (actually the interval $[-1/2,1/2]$ is covered but doesn't show in the contour plot). Therefore the limit does not exist.
What you get when you approach the origin along a straight line can be described as follows. On the upper half plane, a ray emanating from the origin (unless it goes straight up along the $y$-axis, but the function vanishes on both axes so we don't need to worry about that) will meet each an every one of those parabolas. Between the $y$-axis and the parabola $y=mx^2$, the function $f$ takes values $<m/(1+m^2)$, and therefore goes as close to zero as we wish eventually (increasing $m$ decreases the value of $f$).
The killjoy is that to reach function values below a certain $\varepsilon$ we need to go closer and close to the origin as the slope of the ray $\to0$. Let's say that along the ray with slope $k$, we reach values $<\epsilon$ when we are at distance less than $r_k$ from the origin. The trouble with this contrived function is that it is designed in such a way that $r_k\to0$ as $k\to 0+$. If the required distance $r_k$, as a function of the angle of direction $\phi$ of our ray (so $k=\tan\phi$),
were bounded away from zero, then we would have our bivariate limit. But with this given $f(x,y)$ we don't have that.
The design of $f$
A way to build functions like $f(x,y)$ is the following. Consider the variable $t=x^2/y$. If we evaluate it on the line $y=kx$, $k\neq0$, we see that $t=x/k$, so $t$ tends to zero as $x$ does. On the vertical line $x=0$
we obviously have $t=0$. On the other hand, on the horizontal line $y=0$ the variable $t$ is undefined, or loosely speaking, $t=\pm\infty$.
So, depending on the choice of the line through the origin we have either $t\to0$ or $t\to\infty$. If $g(t)$ is a continuous function with the properties $g(0)=0$ and $\lim_{t\to\pm\infty}g(t)=0$, it follows that
$f(x,y):=g(x^2/y)$ behaves just like these examples. We will have
$f(x,y)\to0$ whenever $(x,y)\to(0,0)$ along a ray, but on the parabola
$y=ax^2$ we have $t=1/a$. Therefore $f(x,ax^2)=g(1/a)$, and there is no need for this to vanish.
The choice $g(t)=t/(t^2+1)$ has the prescribed properties and leads to
$f(x,y)=x^2y/(x^4+y^2)$.
Exercise. Design a bivariate function $f(x,y)$ such that it tends to zero along every line through the origin as $(x,y)\to(0,0)$ **as well as
along all the parabola $y=ax^2$, $a\in\Bbb{R}$*. But yet the limit
$\lim_{(x,y)\to(0,0)}f(x,y)$ does not exist. Hint: use $t=x^3/y$.
A: I think your confusion is coming from a misunderstanding of how we evaluate a limit along a line.
Take for example the function mentioned by peter and groupoid in the comments: $$
f(x,y)=\begin{cases}1&y=x^2\\0&\text{otherwise}\end{cases}
$$
Obviously the double limit $$
\lim_{(x,y)\rightarrow 0}f(x,y)
$$
doesn't exist.
If we want to evaluate the limit along a line through the origin, we must first fix such a line, then sticking only with that line, evaluate a limit. Say, I want to evaluate the limit along the line $y=3x$. In evaluating this limit, I have to ignore all other points in the plane. So if I'm stuck on $y=3x$ I can have $$
f(x,y)=f(x,3x)=\begin{cases}1&x\in\{3,0\}\\0&\text{otherwise}\end{cases}
$$
which obviously has limit $0$ as $x$ approaches $0$.
Similarly, along any line $y=mx$, $f$ is $0$ except at the origin and at $(m,m^{2})$, hence the limit along any such line is 0. Also, along the line $x=0$ we have $f$ is $0$ except at the origin, so its limit along this line is also $0$. Thus, once we restrict our attention to any particular line through the origin, we will have a limit of zero along that line.
A: If you use the idea of the Heine-Borel theorem, then it is easier to see.  even just take rational and irrational series respectively in the set of real numbers, the Dirichlet function $D(x)=\begin{cases}1, &x \in \mathbb Q\\0, &x \in \mathbb {R\setminus Q} \end{cases}$ cannot converge to the same limit, which means
$$\forall x_0:\lim_{x\to x_0 \atop x \in \mathbb Q} {D(x)}=1, \lim_{x\to x_0 \atop x \in \mathbb {R \setminus Q}} {D(x)}=0 $$
so the Dirichlet function is not convergent anywhere. Originally, the cardinal of series of real points is $\mathrm{card}\,\{x_n \in \mathbb{R}\mid n \in \mathbb{N}\}=2^{\aleph_1}=\aleph_2$, indicating there is an infinite variety of ways to take series of points convergent to the given number. Instead, it is only because of the total-order nature of the set of real numbers that there are only two limits defined on the intervals thereof, namely, the left and right limits.
A perfect set is a closed set such that every single point in the set is a limit point of the set.
Any perfect subset of the one-dimensional set of real numbers can be expressed by only two points, the starting point and the ending point, so that the cardinal of all the perfect subsets of the set of real numbers is $\aleph _1$. But orderliness no longer exists on higher-dimensional spaces, and any perfect subset thereof must be expressed by all points in it. But again, any segment on the same curve can be expressed by only two points on this curve (and the given curve itself), and thus no more elements are introduced. Thus, the cardinal of perfect subsets on the set of higher-dimensional real numbers is $\aleph_2$, which is exactly the total number of all curves in the space, while all straight lines past a point can be completely determined by an angle, called angle of inclination of a slope, (and the given point itself) so the cardinal is $\aleph_1$.
When we discuss the directions in which a variable converges to a point in the univariate analysis, we restrict the domain of definition to the segment within the line with the given point as the left or the right endpoint, and so we have only two directions, corresponding to the left and the right limit. But when we discuss the directions in which the variables converge to a point in the multivariate analysis, the direction we must examine has to be along all the curves that end at that point, restricting the domain of definition to the segment within all the curves that end at the given point. The all-sided limit of a function cannot then be described merely by describing the limit of the function that restricts the domain of definition to the line that passes through that point.
After understanding the Dirichlet example, don't make a fuss about the different convergence there, let $f(x,y):= \dfrac{xy}{x^2+y^2}$:
$$ \lim_{x \to 0 \atop y = x^2} f(x^2, y)=1 , 
\lim_{x \to 0 \atop y = -x^2} f(x^2, y)=-1 , 
\forall k: \lim_{x \to 0 \atop y = kx} f(x^2, y)=0 $$
Translated with www.DeepL.com/Translator (free version)
