Given a probability space $(\Omega, \mathcal{F},\mathbb{P})$, where $\mathcal{F}$ is a natural filtration generated by a $\mathbb{R}$-valued process $(X_t)_{0 \le t \le T}$ under the Wiener measure $\mathbb{P}$. Given a Borel measurable function $f: \mathbb{R} \times K \mapsto \mathbb{R}$, where $K$ is a compact subset of $\mathbb{R}$, we define a function $g(x) = \max_{y \in K} f(x,y)$.
Can we construct an $\mathcal{F}$-adapted and measurable process $(\alpha_t)_{0 \le t \le T}$ from $(g(X_t))_{0 \le t \le T}$ such that $g(X_t (\omega)) = f(X_t(\omega), \alpha(\omega))$$\mathbb{P}$-a.s.$?$
My attempt: By Axiom of choice and compactness of $K$, we may define a process $(\alpha_t(\omega))_{0 \le t \le T}$ $\mathbb{P}$-a.s. I am confused to show the process is adapted and measurable. The process is adapted intuitively by the construction but I have no idea how to prove this rigorously. Please add more conditions if needed.