[proofplan]
We first stop [Brownian motion](/page/Brownian%20Motion) before it leaves a compact spatial interval, so all derivatives of $f$ are bounded on the relevant time-space compact set. On the stopped compact range, we derive the space-time formula by approximating $f$ with genuinely $C^2$ functions in both variables and applying the continuous-semimartingale Itô formula to $(s,W_s)$. The time coordinate has finite variation, so its quadratic variation and its covariation with $W$ vanish, while Brownian quadratic variation gives the $\frac12\partial_{xx}f$ term. Finally, the stopping levels tend to infinity and the definition of the local Itô integral removes the localization on each compact time interval.
[/proofplan]
[step:Localize Brownian motion and verify boundedness on compact ranges]
Fix $T>0$ and $m\in\mathbb N$. Define the stopping time
\begin{align*}
\tau_m:\Omega&\to[0,T]\\
\omega&\mapsto \inf\{s\in[0,T]: |W_s(\omega)|\ge m\},
\end{align*}
with the convention that the infimum is $T$ when the set is empty. For $0\le r<T$,
\begin{align*}
\{\tau_m\le r\}
=\left\{\sup_{0\le s\le r}|W_s|\ge m\right\}.
\end{align*}
The random variable $\sup_{0\le s\le r}|W_s|$ is $\mathcal F_r$-measurable because $W$ is adapted and continuous, so $\tau_m$ is an $(\mathcal F_t)$-stopping time.
Define the stopped [Brownian motion](/page/Brownian%20Motion)
\begin{align*}
W^m_s:\Omega&\to\mathbb R\\
\omega&\mapsto W_{s\wedge\tau_m(\omega)}(\omega).
\end{align*}
On the compact set
\begin{align*}
K_m:=[0,T]\times[-m,m],
\end{align*}
the continuous functions $\partial_t f$, $\partial_x f$, and $\partial_{xx}f$ are bounded. Hence the stopped finite-variation integrands are bounded, and the stopped stochastic integrand
\begin{align*}
H^m_s:\Omega&\to\mathbb R\\
\omega&\mapsto \mathbb{1}_{[0,\tau_m(\omega)]}(s)\,\partial_x f(s,W_s(\omega))
\end{align*}
is progressively measurable and square-integrable on $[0,T]$.
[/step]
[step:Derive the stopped parabolic formula by smoothing the time variable]
Let $X^m_s:\Omega\to\mathbb R^2$ denote the stopped time-space semimartingale
\begin{align*}
X^m_s(\omega)=(s\wedge\tau_m(\omega),W_{s\wedge\tau_m(\omega)}(\omega)).
\end{align*}
The first coordinate $s\mapsto s\wedge\tau_m$ has finite variation, so
\begin{align*}
[s\wedge\tau_m,s\wedge\tau_m]_t=0,
\qquad
[s\wedge\tau_m,W^m]_t=0.
\end{align*}
The second coordinate has quadratic variation
\begin{align*}
[W^m,W^m]_t=t\wedge\tau_m,
\end{align*}
because [Quadratic Variation of Brownian Motion](/theorems/3543) gives $[W,W]_t=t$ and stopping preserves quadratic variation up to the stopped time.
We first prove the formula for a function $g:\mathbb R^2\to\mathbb R$ of class $C^2$ whose first and second derivatives are bounded on a neighbourhood of $K_m$. Applying [Itô's Formula](/theorems/2099) to $g$ and $X^m$ is legitimate because $X^m$ is a continuous $\mathbb R^2$-valued semimartingale and $g\in C^2(\mathbb R^2)$. The finite-variation coordinate contributes
\begin{align*}
\int_0^{t\wedge\tau_m}\partial_t g(s,W_s)\,d\mathcal L^1(s),
\end{align*}
the Brownian coordinate contributes
\begin{align*}
\int_0^{t\wedge\tau_m}\partial_x g(s,W_s)\,dW_s,
\end{align*}
and the only non-zero quadratic-variation correction is
\begin{align*}
\frac12\int_0^{t\wedge\tau_m}\partial_{xx}g(s,W_s)\,d\mathcal L^1(s).
\end{align*}
Thus, almost surely for all $t\in[0,T]$,
\begin{align*}
g(t\wedge\tau_m,W_{t\wedge\tau_m})
=g(0,W_0)
&+\int_0^{t\wedge\tau_m}\partial_t g(s,W_s)\,d\mathcal L^1(s)
+\int_0^{t\wedge\tau_m}\partial_x g(s,W_s)\,dW_s\\
&+\frac12\int_0^{t\wedge\tau_m}\partial_{xx}g(s,W_s)\,d\mathcal L^1(s).
\end{align*}
It remains to pass from $C^2$ regularity in both variables to $C^{1,2}$ regularity. Since $f\in C^{1,2}$, after extending $f$ to an open neighbourhood of $K_m$ and convolving with a smooth mollifier, there exist functions $f_\varepsilon\in C^2(\mathbb R^2)$ such that
\begin{align*}
f_\varepsilon\to f,\qquad
\partial_t f_\varepsilon\to\partial_t f,\qquad
\partial_x f_\varepsilon\to\partial_x f,\qquad
\partial_{xx} f_\varepsilon\to\partial_{xx} f
\end{align*}
uniformly on $K_m$ as $\varepsilon\to0$. Applying the previous identity to $f_\varepsilon$, the endpoint and finite-variation terms converge uniformly by the displayed [uniform convergence](/page/Uniform%20Convergence). For the stochastic integral, Itô's isometry gives
\begin{align*}
\mathbb E\left[
\left|
\int_0^{t\wedge\tau_m}
\bigl(\partial_x f_\varepsilon(s,W_s)-\partial_x f(s,W_s)\bigr)\,dW_s
\right|^2
\right]
\le T\sup_{K_m}|\partial_x f_\varepsilon-\partial_x f|^2\to0.
\end{align*}
Therefore the stopped identity holds for $f$ for each fixed $t\in[0,T]$. Applying this argument on the [countable set](/page/Countable%20Set) $\mathbb Q\cap[0,T]$ and using the continuity of all four processes in $t$ gives a single event of probability one on which, for every $t\in[0,T]$,
\begin{align*}
f(t\wedge\tau_m,W_{t\wedge\tau_m})
=f(0,W_0)
&+\int_0^{t\wedge\tau_m}\partial_t f(s,W_s)\,d\mathcal L^1(s)
+\int_0^{t\wedge\tau_m}\partial_x f(s,W_s)\,dW_s\\
&+\frac12\int_0^{t\wedge\tau_m}\partial_{xx}f(s,W_s)\,d\mathcal L^1(s).
\end{align*}
[/step]
[step:Remove localization by the definition of the local stochastic integral]
For each $m$, the stopped identity from the previous step holds on an event $\Omega_{T,m}$ with probability one. Let
\begin{align*}
\Omega_T:=\left(\bigcap_{m=1}^{\infty}\Omega_{T,m}\right)
\cap\{\omega\in\Omega: s\mapsto W_s(\omega)\text{ is continuous on }[0,T]\}.
\end{align*}
Then $\mathbb P(\Omega_T)=1$.
Fix $\omega\in\Omega_T$. The continuous path $s\mapsto W_s(\omega)$ has compact image on $[0,T]$, so
\begin{align*}
M_T(\omega):=\sup_{0\le s\le T}|W_s(\omega)|<\infty.
\end{align*}
Choose an integer $m_0>M_T(\omega)$. For every $m\ge m_0$, the stopping time satisfies $\tau_m(\omega)=T$, and consequently $t\wedge\tau_m(\omega)=t$ for every $t\in[0,T]$.
The local stochastic integral
\begin{align*}
I_t:\Omega&\to\mathbb R\\
\omega&\mapsto \int_0^t\partial_x f(s,W_s(\omega))\,dW_s(\omega)
\end{align*}
is defined by the compatible stopped square-integrable integrals:
\begin{align*}
I_{t\wedge\tau_m}
=\int_0^{t\wedge\tau_m}\partial_x f(s,W_s)\,dW_s.
\end{align*}
Compatibility follows from the uniqueness of Itô integrals for integrands that agree up to a stopping time. Hence, for $m\ge m_0$ and $t\in[0,T]$, the stopped stochastic integral in the identity equals $I_t(\omega)$.
Substituting $t\wedge\tau_m=t$ in the stopped identity therefore gives, for every $t\in[0,T]$,
\begin{align*}
f(t,W_t)=f(0,W_0)
&+\int_0^t \partial_t f(s,W_s)\,d\mathcal L^1(s)
+\int_0^t \partial_x f(s,W_s)\,dW_s\\
&+\frac12\int_0^t \partial_{xx}f(s,W_s)\,d\mathcal L^1(s)
\end{align*}
on $\Omega_T$. Since $T>0$ was arbitrary, the identity holds indistinguishably on $[0,\infty)$.
[/step]