the solution of this problem says that since $y^2$ is an even function and so is $cosx-1$ therefore $y'$ is an even function which implies $y$ is odd function and from there on the solution builds up
I can not understand how is $y(x)^2$ even??
here is the full solution https://www.youtube.com/watch?v=WI3UBYJ21iw&t=98s
I am getting more confused now here is one more example where $y^2$ is taken to be even
this is the solution https://www.youtube.com/watch?v=vnqOCpqUebQ

what's going on???

We are given $$y'=y^2-1+\cos x $$ $$y(0)=0$$ Putting $x=0$ gives $$y'(0)=0$$ Differentiating $$y''=2yy'-\sin x $$ Putting $x=0$ gives $$y''(0)=0$$ Differentiating $$y'''=2yy''+2(y')^2-\cos x $$ Putting $x=0$ gives $$y'''(0)=-1$$ So by Taylor's theorem, $$y(x)=y(0)+xy'(0)+\frac12x^2y''(0)+\frac16x^3y'''(0)+O(x^4) =-\frac16x^3+O(x^4) $$ and we see that $y(x)$ is strictly decreasing close to $x=0$.