Let us assume $c:(0,1) \to (\epsilon,+\infty)$ and consider the PDE $$ \begin{cases} u_t+c(x)u_x = 0, \\ u(0,x) = g(x) \\ u(t,0) = f(t) \end{cases} \qquad (t,x) \in (0,T)\times(0,1) \label{1}\tag{$\ast$} $$ Suppose also that the ODE $$\dot x(t) = c(x(t)), \quad x(0) = x_0$$ has a unique solution $x \in W^{1,\infty}(0,T)$.
How can we write down explicitly a solution formula for \eqref{1} using the method of characteristics?
I'm guessing that the explicit solution should be $$ u(t,x) = \begin{cases} g(\beta^{-1}(\beta(x)-t)), \ & (t,x) \in (0,T)\times (0,1), \ t \le \beta(x), \\ f((t-\beta(x)), & (t,x) \in (0,T)\times (0,1), \ t > \beta(x); \end{cases} $$ with $\beta(x) = \int_0^x \frac{dy}{c(y)}$. How can we rigorously prove this with the assumptions given above?