u[x_,t_,k_]=0.5 Erf[(x+1)/Sqrt[4 Pi k t]]-0.5 Erf[(x-1)/Sqrt[4 Pi k t]]

Plot[u[x,0.000001,1],{x,-2,2}]

Animate[Plot[u[x,t,1],{x,-5,5},PlotRange->{0,1.5}],{t,0.0001,2}]

f[x_]=Piecewise[{{x+1,-1≤x≤0},{1-x,0≤x≤1}}]

f[0]

f[1/2]

Plot[f[x],{x,-2,2}]

u[x_,t_,c_]=0.5 f[x-c t]+0.5f[x+c t]

Plot[u[x,2,1],{x,-3,3}]

Animate[
Plot[u[x,t,1],{x,-3,3},PlotRange->{0,1}],
{t,0,5}
]