Denote by $\mathbb{R}^{+}$ the set of all positive real numbers. Find all functions $f: \mathbb{R}^{+} \rightarrow \mathbb{R}^{+}$ such that 
$$ 
x f\left(x^{2}\right) f(f(y))+f(y f(x))=f(x y)\left(f\left(f\left(x^{2}\right)\right)+f\left(f\left(y^{2}\right)\right)\right) 
$$ 
for all positive real numbers $x$ and $y$.
Taking \( x = y = 1 \) in (1), we get \( f(1) f(f(1)) + f(f(1)) = 2 f(1) f(f(1)) \) and hence \( f(1) = 1 \). Putting \( x = 1 \) in (1), we have \( f(f(y)) + f(y) = f(y) \left(1 + f\left(f\left(y^2\right)\right)\right) \) so that 
\[ f(f(y)) = f(y) f\left(f\left(y^2\right)\right). \]
Putting \( y = 1 \) in (1), we get \( x f\left(x^2\right) + f(f(x)) = f(x) \left(f\left(f\left(x^2\right)\right) + 1\right) \). Using (9), this gives 
\[ x f\left(x^2\right) = f(x). \]
Replace \( y \) by \( \frac{1}{x} \) in (1). Then we have 
\[ x f\left(x^2\right) f\left(f\left(\frac{1}{x}\right)\right) + f\left(\frac{f(x)}{x}\right) = f\left(f\left(x^2\right)\right) + f\left(f\left(\frac{1}{x^2}\right)\right). \]
The relation (10) shows \( f\left(\frac{f(x)}{x}\right) = f\left(f\left(x^2\right)\right) \). Also, using (9) with \( y = \frac{1}{x} \) and using (10) again, the last equation reduces to 
\[ f(x) f\left(\frac{1}{x}\right) = 1. \]
Replace \( x \) by \( \frac{1}{x} \) and \( y \) by \( \frac{1}{y} \) in (1) and apply (11). We get 
\[ \frac{1}{x f\left(x^2\right) f(f(y))} + \frac{1}{f(y f(x))} = \frac{1}{f(x y)} \left( \frac{1}{f\left(f\left(x^2\right)\right)} + \frac{1}{f\left(f\left(y^2\right)\right)} \right). \]
Clearing denominators, we can use (1) to simplify the numerators and obtain 
\[ f(x y)^2 f\left(f\left(x^2\right)\right) f\left(f\left(y^2\right)\right) = x f\left(x^2\right) f(f(y)) f(y f(x)). \]
Using (9) and (10), this is the same as 
\[ f(x y)^2 f(f(x)) = f(x)^2 f(y) f(y f(x)). \]
Substitute \( y = f(x) \) in (12) and apply (10) (with \( x \) replaced by \( f(x) \)). We have 
\[ f(x f(x))^2 = f(x) f(f(x)). \]
Taking \( y = x \) in (12), squaring both sides, and using (10) and (13), we find that 
\[ f(f(x)) = x^4 f(x)^3. \]
Finally, we combine (9), (10) and (14) to get 
\[ y^4 f(y)^3 \stackrel{(14)}{=} f(f(y)) \stackrel{(9)}{=} f(y) f\left(f\left(y^2\right)\right) \stackrel{(14)}{=} f(y) y^8 f\left(y^2\right)^3 \stackrel{(10)}{=} y^5 f(y)^4, \]
which implies \( f(y) = \frac{1}{y} \). This is a solution by the checking in Solution 1.