4. Determine all ordered pairs of real numbers $(x, y)$ such that the values of three of the four expressions $x+y, x-y, x y$ and $\frac{x}{y}$ are equal to each other.
Solution. Clearly, $y \neq 0$. If $x+y=x-y$, then $y=0$, which is not possible. Therefore, $x+y \neq x-y$. Now, there are two cases.

First case. Let $x+y=xy=\frac{x}{y}$. From $xy=\frac{x}{y}$, we have $xy^2=x$, or $xy^2-x=0, x(y-1)(y+1)=0$, from which $x=0$ or $y=1$ or $y=-1$. If $x=0$, then we have $y=0$, which is not possible. If $y=1$, then we have $x=x+1$, which is a contradiction. If $y=-1$, then we have $x-1=-x$, from which $2x=1$, so $x=\frac{1}{2}$. Thus, one pair is $(x, y)=\left(\frac{1}{2},-1\right)$.

Second case. Let $x-y=xy=\frac{x}{y}$. Similarly, we have $xy^2=x$, so $x=0$ or $y=1$ or $y=-1$. If $x=0$, then $y=0$, which is not possible. If $y=1$, then we have $-1=0$, which is a contradiction. If $y=-1$, then $x+1=-x$, from which $x=-\frac{1}{2}$. Thus, in this case $(x, y)=\left(-\frac{1}{2},-1\right)$.