I miss something so that I can understand how my teacher finds the solution. I will write the exercise as it is written first.
$$u_x+u_t=u, x\in \mathbb{R}, t>0$$ $$ u(x,0)=\cos x$$ Then I have: $$\frac{\partial x(s)}{\partial s}=1, x(0)=x_0 $$ $$\frac{\partial t(s)}{\partial s}=1, t(0)=t_0 $$ $$\frac{\partial z(s)}{\partial s}=z, z(0)=u(x_0,t_0) $$ I get $$\frac{\partial t}{\partial x}=\frac{\partial t}{\partial s}\frac{\partial s}{\partial x}=1 \Rightarrow t-x=c, t(x_0)=t_0$$ $$\frac{\partial z}{\partial x}=\frac{\partial z}{\partial s}\frac{\partial s}{\partial x}=z\Rightarrow z(x)c e^x$$ We conclude that $t-x$ is constant for all $s$, so $t-x=t_0-x_0$ and from initial conditions
$ z(x_0-t_0)=u(x_0-t_0,0)=\cos(x_0-t_0)$ and $z(x_0-t_0)=ce^{x_0-t_0}$ (I don't understand how I got the first equation)
So $z(x_0)=ce^{x_0}=e^{x_0-t_0}\cos(x_0-t_0)e^{x_0}=\cos(x_0-t_0)e^{t_0} \Rightarrow u(x_0,t_0)=\cos(x_0-t_0)e^{t_0}$ which means that $u(x,t)=\cos(x-t)e^{t}, x \in \mathbb{R}, t>0$
This is my teacher's solution. There is one other example, before this, that explains the method of characteristics which I think I have unsterstood (it's the linear transport equation). From research on the internet and some books I found, I got the idea that $u$ (any book I found doesn't explain why) is constant for $(x,t)$ belonging to the characteristic curve. Well I haven't yet understood why. My teacher says later in her notes that with the characteristics we create the surface of the solution (little-by-little for every value). I found a video and some posts here like this that explain the method but in the examples $\frac{\partial z}{\partial s}=0$ and I can't see how to manage different and more complicates cases. It seems to me that some steps of the solution are missing and I have nowhere found the ideas. In the link above the steps are more clear but I don't understand why we supposed that $s=t$. I just need some explanation around the steps and the thinking I have to do every time (for linear first order PDE generally)and how we thought of using $ x_0-t_0$ in $z(x_0-t_0)$. I think that everything else has been understood. Any explanation is very welcome because I am trying to understand this exercise since yesterday.