$$u_t+C(u)u_x=0\quad\text{where }C(u)\text{ is a given function}$$
GENERAL SOLUTION :
The system of characteristic differential equations is :
$$\frac{dt}{1}=\frac{dx}{C(u)}=\frac{du}{0}$$
A first equation of characteristic cuves comes from $du=0\quad\to\quad u=c_1$ .
A second equation of characteristic cuves comes from $\frac{dt}{1}=\frac{dx}{C(c_1)}\quad\to\quad x-C(c_1)t=c_2$
The general solution of the PDE is expressed on the form of implicit equation $\Phi\left(c_1,c_2\right)=0$ where $\Phi$ is any differentiable function of two variables.
$$\Phi\left(u\:,\:x-C(u)t\right)=0$$
This is a manner to express any relationship between the two variables. This is equivalent to express the relationship by any function $F$ :
$$x-C(u)t=F(u)$$
where $F$ is any derivable function.
In general, this implicit equation cannot be solved for $u$ on closed form.
DETERMINATION OF THE FUNCTION $F$ according to the condition $u(0,t)=g(t)$ :
$0-C\left(g(t)\right)t=F\left(g(t)\right)$
Let $g(t)=X \quad\to\quad t=g^{-1}(X)\quad$ where $g^{-1}$ is the inverse function of $g$.
$$-C(X)g^{-1}(X)=F(X)$$
Thus the function $F$ is now determined, given the functions $C$ and $g$.
PARTICULAR SOLUTION FITTED WITH THE GIVEN CONDITION :
With the particular function $F$ found above :
$x-C(u)t=F(u)$ with $F(u)=-C(u)g^{-1}(u)$
$$x-C(u)t=-C(u)g^{-1}(u)$$
$$x+C(u)\left(g^{-1}(u)-t \right)=0$$
$g^{-1}(u)=t-\frac{x}{C(u)}$
$$u=g\left(t-\frac{x}{C(u)}\right)$$
The result is on the form of implicit equation. Solving for $u$ in order to obtain an explicit form $u(x,t)$ is generally not possible, except in case of particular functions $C$ and $g$.
I believe that the best way to solve this is to draw the $x$-$t$ plane and use the characteristic lines and the fact that the solution to this equation is constant along the characteristic lines.
The first section of the $x$-$t$ plane is when $x>t$ (right of the line with slope 1), which corresponds to information from the initial condition, so $u=0$ in this region.
The second region is where information is carried from the BC $u=1$ from $t\in(0,1)$. In this region, the characteristics have slope $1/3$ in the $x$-$t$ plane, so the characteristics will collide with $x=t$, forming a shock. Nevertheless, we have $u=1$ when $x<t$ and $x>3(t-1)$.
For the third region, which corresponds to $x<3(t-1)$, the slopes of the characteristics vary depending on where they start on the $t$-axis, the value of which we will call $s$. The characteristic lines then have the form $t=x/(1+2s)+s$ and along this characteristic, $u=s$. We can solve this first equation for $s$, which yields a quadratic equation with 2 real roots. One of them is not feasible (remember we need $s>1$) and the other is, so we can write $u(x,t)=s=(-1 + 2 t + \sqrt{(2t+1)^2 - 8 x})/4$
$$
u(x,t) =
\begin{cases}
0, & x\geq t \\
1, & x<t \text{ and }x\geq 3(t-1) \\
\frac{-1 + 2 t + \sqrt{(2t+1)^2 - 8 x}}{4}, & x<3(t-1)
\end{cases}, \ \forall x,t>0.
$$
Best Answer
This follows from the method of characteristics, which provides two sets of curves. The first set of curves is deduced from the initial data. It corresponds to the lines $x = f(C)t + x_0$ along which $u=C$ is constant ($x_0>0$). The second set of curves is deduced from the boundary data. It corresponds to the lines $x=f\circ g(t_0)\, (t-t_0)$ along which $u=g(t_0)$ is constant ($t_0>0$). The restriction $t,x>0$ imposes that all characteristics have positive slope, i.e. $f(C)$ and $f\circ g$ are positive. Moreover, we assume that $g(0) = C$ for compatibility. A shock can only occur in the second family of characteristic curves. To examine the dependence of the solution to the boundary data (see e.g. this post for the case of initial data), we differentiate the expression of characteristic curves w.r.t. $t_0$: $$ \frac{\text d x}{\text d t_0} = (f\circ g)'(t_0)\, (t-t_0) - f\circ g(t_0) . $$ The minimum positive time $t$ which makes this derivative vanish is the breaking time $$ t_b = \inf_{t_0>0} t_0 + \frac{f\circ g(t_0)}{(f\circ g)'(t_0)} \geq 0 . $$ For example, let us consider Burgers' equation $f: u\mapsto u$ with the sinusoidal boundary data defined by $C=1$ and $g(t) = 1+\sin (\pi t)\, \Bbb I_{[0, 1]}(t)$. In this case, a shock forms at $t_b = 0$. If instead $g(t) = 1+\sin^2 (\pi t)\, \Bbb I_{[0, 1]}(t)$, then a shock forms at $t_b \approx 0.6241$.