The total mechanical energy is conserved when a ball is dropped from a height of 4.00 $\mathit{m}$, and it makes a elastic collision with the ground. Assuming no non-conservative forces are acting find the period of the ball. g of course is 9.81.
\begin{align} PE_g &= U_s \\ mgh &= \frac{1}2 kA^2 \\ mgh &= \frac{1}2 kh^2 \\ 2mgh &= kh^2 \\ 2\frac{g}{h} &= \frac{k}{m} \\ \omega &= \sqrt{\frac{k}{m}} = \sqrt{\frac{2g}{h}} \\ T &= \frac{2 \pi}{\omega}=2\pi \sqrt{\frac{h}{2g}} = \sqrt{2} \pi\sqrt{\frac{h} {g}}=2.837 s \end{align}
Is my approach correct?
Fixed Approach
\begin{align} mgh &= \frac{1}2 m v^2_f \\ v_f &= \sqrt{2gh} \\ \frac{v_f - v_0}{g} &= t = \frac{T}{2} \\ 2t &= T = 1.80 s \end{align}
No. The approach is not correct. You don't have an elastic force (except for an instantaneous collision with the ground). During collision, you will just change the sign of the velocity. The approach you are using will result in a harmonic motion, but it is not the case here. It is periodic, but the height does not vary sinusoidaly with time. The ball does not slow down at $2m$, so it gets zero velocity when it touches the ground.
The correct approach is to write the equation of motion in constant acceleration: $$y=y_0+\frac 12 gt^2$$Then solve for $t$ when $y=0$ and $y_0=4m$. This is how much it takes to go down from $4m$ to $0$. It will take also $t$ to get from $0$ to $4m$, so the total time is $2t$, which is the period of the motion.