prove or disprove: if $y'=y^2-\cos(x)$ then any solution diverges in a finite time given the following ode, prove or disprove:

*

*if $y'=y^2-\cos(x)$ then any solution diverges in a finite time.

"diverge" means, that there is a point $x$ where the solution isn't continuous (there and thereafter).

if $y(0)>1$ or $y(0)<-1$ it's clear how to show it.
for instance, take $y(0)>1$, and let say we have $x$ where for the first time $y(x)=1$.
then according to the mean value theorem there is $t$ where $y'(t)<0$ and then it applies that $y(t)<1$, thus $x$ is not the first time we reached $y(x)=1$, therefore there isn't such point.
The problem is showing that if $-1<y(0)<1$ it must go out from this range in a finite time.
Edit
I thought about a solution $y'=y^2-\cos(x)>y^2-1$, which its solution is $\frac{1-e^{2c+2x}}{e^{2c+2x}+1}$, which might have a pole. depending on y(0)

Gosh -- this is hard! I've tried plotting a streamline plot of the ODE, which seems to confirm finite-time blowup. The horizontal axis is the $x$-coordinate; the vertical axis is the $y$-coordinate.

As a rough first argument, you can say that $y^2 + \cos(x) \approxeq y^2$ for $y$ large. More precisely, as $y \to \infty$, we have $y^2 + \cos(x) \to y^2$ since $|\cos(x)| \leq 1$. (You can probably state this precisely using big $O$ notation, but I won't bother.) The solution to $y' = y^2$ is $y(x) = \frac{-1}{x+C}$, which diverges to infinity in finite time for $y>0$. That shows that finite-time blowup if $y$ is large.
To show that $y$ blows up when $y(0)$ is between $-1$ and $1$, you have to show that the graph of $y(x)$ eventually exceeds $y=1$. Then, $y^2 > |\cos(x)|$, so $y'$ will be positive, causing $y$ to increase more, increasing $y^2$ more in turn, which increases $y'$ more, and so on. This is not a rigorous proof, but I'm fairly certain you can use the  argument in the above paragraph to justify this claim precisely.
This reduction makes your task somewhat easier, but I have little clue how to show $y(x)$ eventually exceeds $y=1$ given $y(0)$ between $-1$ and $1$. Here's a possible direction for a proof.
Notice that on the $y$-axis, all slopes are negative, and as $x$ gets larger, $f'(x)$ increases and increases until it diverges. In other words, the second derivative $f''$ (assuming it exists) appears to be positive for some region to the right of the $y$-axis. Differentiating both sides with respect to $x$:
$$f'' = 2y\dfrac{dy}{dx} + \sin (x) > 0 $$
for all $x$ in some interval $[0,M)$. So we get $2y(x) \cdot y'(x) > \sin (x)$. We can solve the equation $2y(x) \cdot y'(x) = \sin (x)$ exactly, and the solution is:
$$y(x) = \sqrt{(2\cos(x) -2C)} $$
This is where I'm stuck. Maybe you can say that $y(x) > \sqrt{(2\cos(x) -2C)}$ and try going from there?
