First, observe that the degree of P(x^2) will be twice the degree of P(x), and that the degree of x^2(x^2+1)P(x) will be 4 greater than the degree of P(x). Taken together, we know that P(x) is a polynomial of degree 4.
Further observations:
P(0^2) = 0(1)P(0) = 0
Thus x is a factor of P(x).
P(1) = P(1^2) = 1(2)(P(1))
=> P(1) = 2P(1)
=> P(1) = 0
Thus (x-1) is a factor of P(x)
0 = P(1) = P((-1)^2) = 1(2)P(-1)
=> P(-1) = 0
Thus (x+1) is a factor of P(x)
With those, we can write P(x) as, for some a, c in RR,
P(x) = cx(x-1)(x+1)(x-a)=cx(x^2-1)(x-a)
Plugging in P(2) = 12, we get
c(2)(3)(2-a) = 12
=> 12c - 6ac = 12
=> 2c - ac = 2
Plugging in P(4) = P(2^2), we get
P(4) = 4(5)(12) = 240
=>c(4)(15)(4-a) = 240
=>240c-60ac = 240
=>4c - ac = 4
Solving the system {(2c-ac=2),(4c-ac=4):}, we arrive at
{(a = 0),(c = 1):}
:. P(x) = x^2(x^2-1) = x^4-x^2