Case 1. $x=1$. Evaluating the equation we get $y + 1/1 = 1 + y/1$, which is true, as required .
Case 2. $y=1$. Evaluating the equation we get $1 + 1/x = 1+1/x$, which is true, as required.
So, would it be invalid to it like that?
I think, that is not correct . Because, the original statement requires the bidirectional conclusion . You need to prove that, $y + 1/x=1+y/x$ is correct, $\color{red}{\rm {iff}}$ when $x=1$ or $y=1$ . But, not only $\color{red}{\rm {if}}$ $x=1$ or $y=1$, then $y + 1/x=1+y/x $ is correct.
Solving the equation respect to $y$, you have:
If $x≠1$, then you have $y=1$ :
$$y=\frac {x-1}{x-1}=1$$
$\color{red}{\rm{and}}$ if $x=1$, then $y+1=1+y\thinspace $ which is correct .
Similarly, if $y≠1$ then you have $x=1$ :
$$x=\frac {y-1}{y-1}=1$$
$\color{red}{\rm{and}}$ if $y=1$, then $1+1/x=1+1/x\thinspace $ which is also correct .
This completes the answer .
But, the quick computation is also possible . Indeed,
$$
\begin{align}&y+\frac 1x=1+\frac yx\\
\iff &y+\frac 1x-1-\frac yx=0\\
\iff &(y-1)-\frac 1x(y-1)=0\\
\iff &\frac {(x-1)(y-1)}{x}=0\thinspace .\end{align}
$$
which is equivalent to :
For all $x≠0$, the equality
$$y+\frac 1x=1+\frac yx$$ holds, if and only if, when $x=1$ or $y=1\thinspace .$