Proving the solution of a Cauchy problem is continuous 
Determine for $I_{(t_0,x_0)}$ the maximal domain that defines the solution $\phi_{(t_0,x_0)}(.)$ for the Cauchy problem:
$$
\begin{cases}
\dot{x}=f(x)g(t)\\
x(t_0)=x_0
\end{cases}
$$
where $f$ is continuous and non-zero in the interval $[a_1,a_2]$ and $g$ is contious in the interval $(t_1,t_2)$.
Show that the set $\mathscr{D}=\{(t,t_0,x_0):t_0,x_0\in(t_1,t_2)\times(a_1,a_2)\}$ and $t\in I(t_0,x_0)$ is open and the function $\varphi:D\to\mathbb{R}$ given by $\varphi_{(t,t_0,x_0)}=\varphi_{(t_0,x_0)}(t)$ is continuous on $D$.

I have no idea on how to solve this exercise. I thought of using the Picard theorem: admitting the problem has a solution then $f$ would be Lipschitz contious which would imply $\varphi$ to be continuous. But I am not sure I could use the reverse implicarion of the theorem is valid.
Question:
How should I solve this problem?
Thanks in advance!
 A: First, a counterexample: for $-a_1=a_2=1,g=1,f(x)=1+x^2$, the maximal interval $I_{(0,0)}$ is $[-\pi/4,\pi/4]$, not open! 
So I am assuming $f$ is actually defined on $(a_1,a_2)$. The “proof” below isn’t complete, some detail is omitted.  
First, it is easy to show that if $F$ is a given antiderivative of $1/f$ (so $F$ monotonous), $G$ some antiderivative of $g$, $x$ is a solution of the differential equation iff $x=F^{-1}(G(t)+c)$ for some constant $c$. 
As a consequence, $(t,t_0,x_0) \in D$ iff $t_1 < t,t_0<t_2$ and $a_1<x_0<a_2$ and there exists some $c$ such that $F^{-1}(G(t_0)+c)=x_0$ and $G(t)+c$ is in the domain of $F^{-1}$ (which we denote as $(b_1,b_2)$). Note that in this case, $c=F(x_0)-G(t_0)$. 
Thus, $(t,t_0,x_0) \in D$ iff $t,t_0 \in (t_1,t_2)$, $x_0 \in (x_1,x_2)$ and $G(t)-G(t_0)+F(x_0) \in (b_1,b_2)$. This is clearly an “open condition”. 
For the second part, just note from the above that $\varphi_{(t_0,x_0)}(t)=F^{-1}(G(t)-G(t_0)+F(x_0))$, hence the global flow is clearly continuous.
