How to apply apply Grönwall's inequality for $y'(t)\le af(t)^2 y(t)+b$? Following this question: Can we get an upper bound for $y(t)$?
Define a smooth function $y(t): R\to [-2, \infty)$ and another function $f(t): R\to [-1, 1]$ with $|f(t)|\le 1$.
Assume that $$y'(t)\le af(t)^2 y(t)+b$$
where $a, b \ge 0$.
Can we still apply Grönwall's inequality?

Multiply by $\exp(-\int_0^t af^2(u)du)$, then
$$
\exp(-\int_0^t af^2(u)du)(y'(t)-af(t)^2 y(t))\le b\exp(-\int_0^t af^2(u)du)\le b
$$
where since we have $af^2(u)\ge 0$, then $\exp(-\int_0^t af^2(u)du)\le 1$.
Note that the Left hand side is
$$
\left(\exp\left(-\int_0^t af^2(u)du\right) \cdot y(t)\right)' \le b
$$
So we get
$$
\exp\left(-\int_0^t af^2(u)du\right) \cdot y(t)- y(0)\le \int_0^t b dt.
$$
Hence,
$$
y(t)\le (y(0)+bt)\exp\left(\int_0^t af^2(u)du\right)
$$
 A: It's still possible to apply Gronwall's inequality, but the solution is more cumbersome than finding directly the upper bound of $y(t)$.
$$\begin{align}
&\Longleftrightarrow y(t)-af^2(t)y(t) \le b \\
&\Longleftrightarrow e^{-G(t)}\left(  y(t)-af^2(t)y(t)   \right)\le b e^{-G(t)} \tag{1}\\
\end{align}$$
with $G(t)$ is defined by
$$G'(t)=af^2(t)  \Longleftrightarrow G(t) =\int_0^taf^2(u)du+G(0)$$
Then
$$\begin{align}
&\Longleftrightarrow \left(e^{-G(t)}y(t) \right)'\le b e^{-G(t)}\\
&\Longleftrightarrow e^{-G(t)}y(t) - e^{-G(0)}y(0)\le b \int_0^t e^{-G(u)}du\\
&\Longleftrightarrow y(t) \le e^{G(t)} \left(b \int_0^t e^{-G(u)}du + e^{-G(0)}y(0)\right) =b \int_0^t e^{G(t)-G(u)}du +y(0)e^{G(t)-G(0)}\\
\end{align}$$

Solution with Gronwall's inequality
$$\begin{align}
&\Longleftrightarrow (y(t)-h(t))' \le af^2(t)(y(t)-h(t)) \tag{2}\\
\end{align}$$
with $h(t)$ satisfying
$$h'(t) - af^2(t)h(t) = b \tag{3}$$
The equation $(3)$ can be solved easily. And we apply the Gronwall's inequality on $(2)$.
