There's nothing wrong with "changing" or substituting expressions for both $x$ and $y$. However, we can only use one variable across both expressions.
What does looking at a function along different paths mean? For our purposes, a path is just a curve, which we often associate with a parametrization $\vec{r}(t)$. So if we have a two-variable function $f(x,y)$, when we restrict our attention to a specific path, what we're really doing is considering $f\bigl(\vec{r}(t)\bigr)$, which is a single-variable function. This allows us to use all of our tools from single-variable calculus!
I think many textbooks obscure this idea in their treatments of multivariable limits by presenting evaluating a function along a path as performing a substitution. For example, following a certain popular commercial text, the problem you gave would be done like this.
Along the $x$-axis, every point is of the form $(x,0)$, and the limit along this approach is
$$\lim_{(x,0)\to(0,0)}\frac{x \cdot 0}{x^2+0^2}=0.$$
However, when $(x,y)$ approaches $(0,0)$ along the line $y=x$, we obtain
$$\lim_{(x,x)\to(0,0)}\frac{x \cdot x}{x^2+x^2}=\frac{1}{2}.$$
The limit does not exist because two approaches produce different limits.
Another popular text is similar, perhaps marginally better.
Let's approach $(0,0)$ along the $x$-axis. On this path $y=0$ for every point $(x,y)$, so for all $x\neq0$, the function becomes $$f(x,0)=0/x^2=0,$$ and thus
$$f(x,y)\to0 \quad \text{as} \quad (x,y)\to(0,0)\,\text{ along the $x$-axis.}$$
Let's now approach $(0,0)$ along another line, say $y=x$. For all $x\neq0$,
$$f(x,x)=\frac{x^2}{x^2+x^2}=\frac{1}{2},$$
therefore
$$f(x,y)\to\tfrac{1}{2} \quad \text{as} \quad (x,y)\to(0,0)\,\text{ along $y=x$.}$$
Since we have obtained different limits along different paths, the given limit does not exist.
In both of these approaches, it appears as though we're simply performing the substitutions $(x,y)=(x,0)$ and $(x,y)=(x,x)$. So why doesn't $(x,y)=(y,x)$ work? Or if we want to approach $(0,0)$ along $y=2x$, why can't we do $(x,y)=(y/2,2x)$? It's because these aren't parametrizations of curves—they aren't paths.
Vector-valued functions and parametrizations of curves are presented before multivariable limits in both of the texts I referenced. So I think a better approach would be something like this.
We can approach $(0,0)$ along the $x$-axis by following the path $$\vec{r}(t)=(t,0)\,\text{ as }\, t\to0.$$ This gives us
$$\lim_{t\to0} f\bigl(\vec{r}(t)\bigr)=\lim_{t\to0}\frac{t \cdot 0}{t^2+0^2}=0.$$
We can also approach $(0,0)$ along the line $y=x$ by following the path
$$\vec{s}(t)=(t,t)\,\text{ as }\, t\to0.$$ This gives us
$$\lim_{t\to0} f\bigl(\vec{s}(t)\bigr)=\lim_{t\to0}\frac{t \cdot t}{t^2+t^2}=
\frac{1}{2}.$$
The limits along different paths do not agree, therefore the limit does not exist.