Without going into a full explanation on why the method works, what you typically do is: if your initial condition is written in the form [itex]u(x,x)=g(x)[/itex], then your initial conditions for your characteristics become [tex]x(0)=x_0\\<br />
y(0)=x_0\\<br />
u(0)=g(x_0).[/tex] Sometimes the initial condition might look different. For example, if you had the initial condition [itex]u(5,y)=g(y)[/itex], then your initial condition would be[tex]x(0)=5\\<br />
y(0)=y_0\\<br />
u(0)=g(y_0).[/tex] Essentially, you parameterize the initial curve. In the case where you have [itex]n[/itex] independent variables, so [itex]u=u(x_1,\cdots,x_n)[/itex], you would parameterize the initial curve using at most [itex]n-1[/itex] parameters. Here, we had n=2, and I denoted the parameter by [itex]x_0[/itex]. We had the initial curve [itex]u(x,x)=x[/itex], so the "x" coordinate is represented by [itex]x_0[/itex], the "y" coordinate is also represented by [itex]x_0[/itex], as is the "u" coordinate. This curve is actually just a line in [itex]\mathbb{R}^3[/itex]; we can write it as [itex]\{(x,y,u)\in\mathbb{R}^3 : x=y=u\}[/itex].
For example, we could look at an initial curve in a system with three independent variables, but now the curve would (in general) be represented with up to two parameters. eg: if we had [itex]u(x,x,z)=3z-\log(x^2)[/itex], the we could parameterize this by [itex]x_0,z_0[/itex] and we would get[tex]x(0)=x_0\\<br />
y(0)=x_0\\<br />
z(0)=z_0\\<br />
u(0)=3z_0-\log(x_0^2).[/tex] Do you understand the procedure?
If you want to understand how/why this works, then any decent PDE textbook with an emphasis on explicitly solving PDEs should cover this. There are also numerous resources online.