Step 1: Boundary conditions.
For an infinite potential well:
\[
\psi(0) = 0,\quad \psi(L) = 0
\]
Step 2: Test each option.
(A) $\cos(n\pi x/L)$ is not zero at $x=0$. Not allowed.
(B) $x+x^2$ is not zero at $x=0$. Not allowed.
(C) $x^3(x-L)$ is zero at both $x=0$ and $x=L$. Acceptable.
(D) Reciprocal sine diverges; not physical.
Step 3: Conclusion.
Only option (C) satisfies both boundary conditions and is finite everywhere.