We have $f: (0, \infty)\rightarrow (0, \infty)$ such that $f(x f(y)) = x^2 y^a~\forall x, y\in(0, \infty)$.
For $x\leftarrow 1$:
- $f(f(y)) = y^a~\forall y\in(0, \infty)$
For $y\leftarrow f(y)$:
- $f(x f(f(y))) = x^2 f(y)^a~\forall x, y\in(0, \infty)$
By replacing 1. in 2. we have
- $f(x y^a) = x^2 f(y)^a~\forall x, y\in(0, \infty)$
In 3., for $y\leftarrow 1$, we have
- $f(x) = x^2 f(1)^a~\forall x\in(0, \infty)$
In 4., for $x\leftarrow 1$, we have
- $f(1) = f(1)^a$
As $f(1)\neq 0$, we shall have $f(1)^{1-a} = 1$, therefore $f(1) = 1$ or $a = 1$:
If $a = 1$, then, replacing 3. in the original equation, we have
$\begin{aligned}
f(x f(y)) &= x^2 y^a&\forall x, y\in(0, \infty)&\implies\\
f(x y^2 f(1)) &= x^2 y&\forall x, y\in(0, \infty)&\implies\\
x^2 y^4 f(1)^3 &= x^2 y&\forall x, y\in(0, \infty)&\implies\\
f(1)^3 &= y^{-3}&\forall y\in(0, \infty)&\implies\\
f(1) &= y^{-1}&\forall y\in(0, \infty)
\end{aligned}$
which is clearly absurd, therefore $f(1) = 1$, so, by 4., we have $f(x) = x^2~\forall x\in(0, \infty)$, so
$$f(xf(y)) = x^2 y^a~\forall x, y\in(0, \infty)\implies x^2 y^4 = x^2 y^a~\forall x, y\in(0, \infty)$$
therefore $a = 4$.