Let $f: S \times [0, \infty)\rightarrow \mathbb{R}$ satisfy $f(x, t)$ is continuous in $x$ for each $t$ and right continuous in $t$ for each $x \in S$. Here $S$ is a metric space. Why is $f$ Borel measurable? (In the joint sense) I am vaguely familiar with the idea of proof I did a long time ago for if $S$ is instead a Euclidean space, and we have full continuity instead of only right. Then one interpolated. But you can't do that here anyway, since $S$ is not Euclidean, and nevermind the fact that you only have right continuity anyway. I also tried to write $f$ as a limit of joint measurable functions using the right continuity, but failed.
[Math] right continuous continuous function is measurable
analysismeasure-theoryreal-analysis
Related Solutions
That's wrong. Let $f\colon[0,1] \to \mathbb R$ be given by \[ x\mapsto \begin{cases} 1 & x = 0\\ 0 & x > 0 \end{cases} \] Then $f$ is not continuous, but it is, restricted to $D := \{0\}$ and $E := (0,1]$, both of which are measurable.
Let me add something concerning your edit: As the example above shows, for just measurable parts $D$ and $E$ continuity of $f|_D$ and $f|_E$ doesn't imply that of $f$ on $D \cup E$. But if both $D$ and $E$ are open in $D \cup E$ or both closed, then your result holds:
For open $D$ and $E$ we argue as follows: Let $U \subseteq \mathbb R$ be open, then we have $f^{-1}[U] = f|_D^{-1}[U] \cup f|_E^{-1}[U]$. Now, $f|_D^{-1}[U]$ is open in $D$ by continuity of $f|_D$, as $D$ is open in $D\cup E$, $f|_D^{-1}[U]$ is also. By the same argument, replacing $D$ by $E$, $f|_E^{-1}[U]$ is open in $D\cup E$, hence $f^{-1}[U]$ is, proving the continuity of $f$.
The case of closed sets can be proved by exactly the same argument, replacing every "open" above by "closed".
Edit: following the comment of kahen below, I modified my answer: Lebesgue-measurability of a function $h$ is measurability of $h\colon (X,\mathcal{L}_X)\to (Y,\mathcal{B}_{Y})$, not $h\colon (X,\mathcal{L}_X)\to (Y,\mathcal{L}_{Y})$)
You have that $f\colon (X,\mathcal{L}_X)\to (\mathbb{R},\mathcal{B}_\mathbb{R})$ is Lebesgue-measurable (for the $\sigma$-algebras $\mathcal{L}_X$, $\mathcal{B}_\mathbb{R}$). As $g\colon \mathbb{R}\to \mathbb{R}$ is continuous, it is Borel-measurable ($g\colon (\mathbb{R},\mathcal{B}_\mathbb{R})\to (\mathbb{R},\mathcal{B}_\mathbb{R})$ is measurable for the $\sigma$-algebras $\mathcal{B}_\mathbb{R}$, $\mathcal{B}_\mathbb{R}$). You want to show that $g\circ f$ is Lebesgue-measurable. i.e. $g\circ f \colon (X,\mathcal{L}_X)\to (\mathbb{R},\mathcal{B}_\mathbb{R})$ is measurable.
Take any $B\in\mathcal{B}_\mathbb{R}$: you need to show that $(g\circ f)^{-1}(B)\in \mathcal{L}_X$.
By measurability of $g$, you have that for since $B\in\mathcal{B}_\mathbb{R}$, $B^\prime = g^{-1}(B)\in \mathcal{B}_\mathbb{R}$. By measurability of $f$, this implies that $f^{-1}(B^\prime)\in \mathcal{L}_X$, i.e. $(g\circ f)^{-1}(B)\in \mathcal{L}_X$. This shows that $g\circ f$ is measurable for the $\sigma$-algebras $\mathcal{L}_X$, $\mathcal{B}_\mathbb{R}$ (i.e., $g\circ f\colon (X, \mathcal{L}_X)\to (\mathbb{R}, \mathcal{B}_\mathbb{R})$ is measurable), as wanted.
Best Answer
For a separable metric space $S$, we can use the
Lemma:
Let $S$ be a separable metric space, $Y$ a topological space, and $f \colon S\times Y \to \mathbb{R}$ a function such that
Then $f$ is measurable.
Proof:
Let $D = \{s_\nu\colon\nu\in\mathbb{N}\}$ be a countable dense subset of $S$.
For $n \geqslant 1$, let $\mathfrak{U}_n = \{B(\frac1n,\,s)\colon s \in D\}$. Since $D$ is dense, $\mathfrak{U}_n$ is an open covering of $S$. Metric spaces are paracompact, hence there is a subordinate partition of unity
$$\{\varphi_{n,\nu} \in \mathscr{C}(S,\mathbb{R}) \colon 0 \leqslant \varphi_{n,\nu}(s) \leqslant 1,\, \operatorname{supp} \varphi_{n,\nu} \subset B(\frac1n,\, s_\nu)\},\quad \sum_{\nu \in \mathbb{N}} \varphi_{n,\nu} \equiv 1,$$
with the family $\{\operatorname{supp}\varphi_{n,\nu}\colon \nu\in\mathbb{N}\}$ locally finite.
Let $g_{n,\nu}(s,y) = \varphi_{n,\nu}(s)\cdot f(s_\nu,\, y)$ and $g_n(s,\,y) = \sum\limits_{\nu \in\mathbb{N}} g_{n,\nu}(s,\,y)$.
$g_{n,\nu}$ is measurable (as the product of the measurable functions $\varphi_{n,\nu} \circ \pi_S$ and $f(s_\nu,\,\cdot) \circ \pi_Y$), and $g_n = \lim\limits_{k\to\infty} \sum\limits_{\nu = 0}^k g_{n,\nu}$ is the pointwise limit of measurable functions, hence measurable (since the family of supports is locally finite, the sum contains only finitely many non-zero terms at each point, so convergence is assured).
Now, $f = \lim\limits_{n\to\infty} g_n$ shows that $f$ is measurable.
To see the latter limit, fix $(s,\,y) \in S\times Y$, and $\varepsilon > 0$. Since $f(\cdot,\,y)$ is continuous, there is an $n \in \mathbb{Z}^+$ with $d(s,\,t) < \frac1n \Rightarrow \lvert f(t,\,y) - f(s,\,y)\rvert < \varepsilon$. Then
$$\lvert g_n(s,\,y) - f(s,\,y)\rvert = \left\lvert\sum_{\nu \in \mathbb{N}} \varphi_{n,\nu}(s)\cdot\bigl(f(s_\nu,\,y) - f(s,\,y)\bigr) \right\rvert \leqslant \sum_{\nu \in \mathbb{N}} \varphi_{n,\nu}(s)\cdot \lvert f(s_\nu,\,y) - f(s,\,y)\bigr\rvert < \varepsilon$$
since whenever $\varphi_{n,\nu}(s) \neq 0$, we have $d(s,\,s_\nu) < \frac1n$ and hence $\lvert f(s_\nu,\,y) - f(s,\,y)\bigr\rvert < \varepsilon$.
With the above lemma, all that remains to be shown is that a right-continuous function $h \colon [0,\,\infty) \to \mathbb{R}$ is measurable.
Let $t_n(x) = (\lfloor 2^nx\rfloor + 1)/2^n$, and $h_n(x) = h(t_n(x))$. Then $t_n$ (and hence $h_n$) is constant on each interval $[m/2^n,\, (m+1)/2^n)$, and $t_n(x) \searrow x$ monotonically. Therefore $h_n$ is measurable, and the right-continuity of $h$ implies that $h_n \to h$ pointwise.
For the general case where $S$ is not assumed separable:
(From the abstract of Maxim R. Burke, Borel measurability of separately continuous functions, in "Topology and its Applications", 129, 1.)
I don't have a proof of Rudin's result handy, but, accepting that, we know that a separately continuous function $f \colon X \times Y \to \mathbb{R}$ is Borel measurable.
Now, don't equip the interval $[0,\,\infty)$ with the standard topology $\mathcal{T}_s$, instead use the topology $\mathcal{T}_h$ generated by the half-open intervals $[a,\,b)$.
Take that as the space $Y$. A function $g \colon \bigl([0,\,\infty),\, \mathcal{T}_h\bigr) \to \mathbb{R}$ is continuous if and only if $g \colon \bigl([0,\,\infty),\, \mathcal{T}_s\bigr) \to \mathbb{R}$ is right-continuous.
So by that result, your
$$f \colon S \times Y \to \mathbb{R}$$
is Borel-measurable.
But the Borel $\sigma$-algebra generated by $\mathcal{T}_h$ is the same as that generated by $\mathcal{T}_s$.