EnergyLevel[e_]:=Line[{{-Sqrt[e],e},{Sqrt[e],e}}];

shoLevelPlot[e_]:=Plot[x^2,{x,-2.75,2.75},Epilog->Flatten[{Red,Thick,Line[{{-3.35,e},{3.35,e}}],Dashed,Black,Thickness[0.004],Table[EnergyLevel[w],{w,0.5,7.5,1}]},1],PlotStyle->{Black,Thickness[0.005]},AxesLabel->{"x"},PlotLabel->"harmonic oscillator potential",ImageSize->Scaled[0.5]];

Manipulate[
Grid[{{Plot[Evaluate[y[x]/.NDSolve[{-0.5y''[x]+0.5 (x^2)y[x]-energy y[x]==0,y[1.]==1.,y[-1.]==pf 1.},y,{x,-5.9,5.9}]],{x,-5.5,5.5},PlotRange->{{-6,6},Automatic},PlotStyle->Thickness[.007],AxesLabel->{"x",""},PlotLabel->"wavefunction ψ(x)",ImageSize->Scaled[0.5],ImagePadding->{{25,25},{25,25}}],shoLevelPlot[energy]}}],{{energy,0.5},0.,7.5,.00001},
{{energy,0.5,"allowed energy values (even parity)"},{0.5,2.5,4.5,6.5},Enabled->pf==1},
{{energy,0.5,"allowed energy values (odd parity)"},{1.5,3.5,5.5,7.5},Enabled->pf==-1},
{{pf,1,"parity"},{1->"even",-1->"odd"}},
SaveDefinitions->True]