Answer
$T = \frac{2\pi}{\sqrt{\frac{2amg}{-x}}}$
Work Step by Step
We first write an equation for the gravitational potential energy of the mass:
$U=mgh = amgx^2$
We know the following equation for the angular velocity:
$\frac{dx^2}{dt^2}=-\omega^2 x $
Thus, we take the second derivative of the original equation to find:
$2amg = -\omega^2 x $
$ \omega = \sqrt{\frac{2amg}{-x}}$
This means that the period is:
$T = \frac{2\pi}{\sqrt{\frac{2amg}{-x}}}$