[step:Remove the finite endpoint and prove forward completeness]
Now fix any $t\in[0,T_{\max})$ and apply the previous estimate with $T=t$ when $t>0$. For $t=0$, the estimate follows directly from $|x(0)|=|x_0|$. Thus, for every $t\in[0,T_{\max})$,
\begin{align*}
|x(t)|\leq \max\left\{\beta(|x_0|,t),\gamma_0\left(\|w\|_{L^\infty(0,t)}\right)\right\}.
\end{align*}
Since $\max\{a,b\}\leq a+b$ for $a,b\geq 0$, this implies
\begin{align*}
|x(t)|\leq \beta(|x_0|,t)+\gamma_0\left(\|w\|_{L^\infty(0,t)}\right).
\end{align*}
It remains to show that $T_{\max}=\infty$. Suppose instead that $T_{\max}<\infty$. Since $w$ is locally essentially bounded, the number
\begin{align*}
M_*:=\|w\|_{L^\infty(0,T_{\max})}
\end{align*}
is finite. Applying the estimate for every $t<T_{\max}$ gives
\begin{align*}
|x(t)|\leq \beta(|x_0|,0)+\gamma_0(M_*),
\end{align*}
because $\beta(|x_0|,t)\leq \beta(|x_0|,0)$ for all $t\geq0$. Thus the trajectory remains in the compact Euclidean ball
\begin{align*}
\overline{B}\left(0,\beta(|x_0|,0)+\gamma_0(M_*)\right)
\end{align*}
on $[0,T_{\max})$. Local Lipschitz continuity of $f$ and essential boundedness of $w$ on $[0,T_{\max})$ imply that a solution whose state remains bounded cannot have a finite maximal existence time. This contradicts the definition of $T_{\max}$. Hence $T_{\max}=\infty$.
Taking $\gamma:=\gamma_0$ gives functions $\beta\in\mathcal{KL}$ and $\gamma\in\mathcal{K}_\infty$ such that
\begin{align*}
|x(t)|\leq \beta(|x_0|,t)+\gamma\left(\|w\|_{L^\infty(0,t)}\right)
\end{align*}
for every $x_0\in\mathbb{R}^n$, every measurable locally essentially bounded input $w$, and every $t\geq0$. This is exactly input-to-state stability.
[/step]