ODE IVP : $u_t + uu_x = 1, \; \; u(x,0) = x$ Exercise :

Solve the IVP :  $u_t + uu_x = 1, \; \; u(x,0) = x$

Attempt :
$$\frac{\mathrm{d}x}{u} = \frac{\mathrm{d}t}{1} = \frac{\mathrm{d}u}{1}$$
Thus, the two linearly independent integral curves, are :
$$u_1 = t-u$$
$$u_2 = \frac{1}{2}(u^2 - 2x)$$
The solution then will be given as an expression of a differentiable function $F$, such as :
$$F(u_1,u_2)  \Rightarrow F\bigg(t-u,\frac{1}{2}(u^2 - 2x)\bigg) = 0$$
which agrees with the wolfram alpha result I yielded for this problem.
Now, taking into account the initial value $u(x,0) = x$, we have :
$$F\bigg(0 - u(x,0), \frac{1}{2}(u^2(x,0) - 2x)\bigg) = 0 \Rightarrow F\bigg(-x, \frac{1}{2}(x^2-2x)\bigg) = 0$$
How to proceed with approaching the solution for the IVP further now ?
 A: Edit: Referring to your solution, in order for
$$ F\left( -x, \frac 1 2 (x^2 - 2x) \right) = 0$$
to be true, you need
$$ F(u_1, u_2) = - \frac 1 2 u_1^2 - u_1 + u_2.$$
With $u_1 = t - u$ and $u_2 = \frac 1 2 (u^2 - 2x)$, this gives
$$ - \frac 1 2 (t - u)^2 - (t - u) + \frac 1 2 (u^2 - 2x) = 0,$$
which simplifies to give
$$ u = \frac {x + t + \frac 1 2 t^2 }{1 + t}.$$

Original answer: This is a solution using the method of characteristics. The idea is to study the behaviour of $u$ on a carefully-chosen family of curves in $(x,t)$-space on which the equation is tractable.
So suppose $u(x,t)$ is a solution to the PDE. Let us consider a particular family of curves  $s \mapsto (x(s), t(s))$, namely, the family of curves that obey the differential equations
$$ \frac{dt(s)}{ds} = 1, \ \ \ \ \ \ \frac{dx(s)}{ds} = u(x(s), t(s)) .$$
Using the chain rule, together with the original PDE, you can verify that on any curve in this family, the function $s \mapsto u(s) := u(x(s), t(s))$ obeys the differential equation
$$ \frac{du}{ds} = 1. $$
Solving these differential equations, we see that, for any curve within our family, $t(s), x(s)$ and $u(s)$ are of the form,
$$ t(s) = a + s, \ \ \ x(s) = b + cs + \tfrac 1 2 s^2, \ \ \ u(s) = c + s.$$
where the constants $a, b, c$ are particular to the specific curve that we are considering.
There is some redundancy in these constants $a, b, c$. Firstly, we may assume $a = 0$ without loss of generality, because this can be compensated for by redefining $s \mapsto s + a$. Secondly, the boundary condition $u(x, 0) = 0$ ensures that $c = b$.
So to summarise, we have defined a family of curves that foliate our domain. The members of this family are labelled by $c$; each choice of $c$ corresponds to a different curve within our family. The trajectory of each individual curve is parameterised by the parameter $s$, and the expressions for $t(s)$, $x(s)$ and $u(s):=(x(s),t(s))$ along the curve are given by
$$ t(s)=s, \ \ \ \ \ x(s)=c+cs+\tfrac 1 2 s^2, \ \ \ \ \ u(s) = c + s.$$
Now suppose we pick a point $(x,t)$. To solve the problem you posed in your question, we are required to provide the value of $u$ at this point $(x, t)$.
 And to do this, it would be helpful if we can figure out: (i) which curve within our family of curves this point lies on (i.e. what value of $c$ corresponds to the curve that contains this point), and (ii) what value of $s$ describes to the location of the point on this curve.
Clearly, the answer to (ii) is that the value of $s$ describing the location of our point on its curve is $$s = t.$$ Having identified this, it is immediate that from the equation $x = c + ct + \tfrac 1 2 t^2$ that the answer to (i) is that the curve containing our point is the curve whose value of $c$ is
$$ c=\frac{x-\tfrac 1 2 t^2}{1+t}. $$
Finally, using the expression $u(s)=c+s$, which provides the value of $u$ at a particular position on a particular curve, and substituting in the value of $c$ corresponding to our curve and the value of $s$ corresponding to the location of our point on this curve, we have
$$ u(x,t)=\frac{x + t + \tfrac 1 2 t^2}{1+t},$$
and this is the solution to the original problem.
