Assume the domain $f$ is $\mathbb{R}^+ = \{x \in \mathbb{R}: x > 0\}$, not $\mathbb{R}$. This approach is similar to Mishikumo2019's.
In the functional equation $f(x f(y)) = y f(x)$, setting $x = 1$ and rewriting $y$ as $x$ gives $$f(f(x)) = x f(1).$$ The RHS increases without bound but $f(x) \to 0$ as $x \to \infty$, so for every value $Y \in \mathbb{R}^+$ there exists some $\delta > 0$ such that if $x < \delta$ and $x \in f(\mathbb{R}^+)$, then $f(x) > Y$: that is, $\lim_{x \to 0^+} f(x) = +\infty$ if the domain of $f$ is restricted to the range of $f$. (With the additional hypothesis that $f$ is continuous, this is equivalent to $\lim_{x \to 0^+} f(x) = +\infty$.)
We know from setting $x = y$ in the functional equation that any number of the form $x f(x)$ is a fixed point of $f$; as a corollary, $f$ has at least one fixed point. If $x_0$ is a fixed point, then so is $x_0 f(x_0) = x_0^2$ and, more generally, $x_0^{2^n}$ for any $n \in \mathbb{N}$. If $x_0 \neq 1$, then we have a sequence of fixed points approaching zero (contradicting the fact that $\lim_{x \to 0^+} f(x) = +\infty$ when the domain of $f$ is restricted to the range of $f$) or extending out to infinity (contradicting $\lim_{x \to \infty} f(x) = 0$). Thus, the only fixed point of $f$ is $1$, so $x f(x) = 1$ for all $x \in \mathbb{R}^+$, and thus the only possible $f$ is $f(x) = 1/x$.
The equation $f\bigl(yf(y)\bigr)=yf(y)$ only tells you that $f$ acts as the identity function on the set of values ${yf(y)\mid y\in\Bbb R}.$ However, this cannot be all of $\Bbb R,$ since the codomain has no negative numbers as elements.
– Cameron Buie Aug 08 '19 at 17:54