s[x_] := 
      If[5 ≤ x < 6, x - 5, 
        If[6 ≤ x ≤ 7, 7 - x, 
          0]]
im1[x_] := 
      If[-7 ≤ x < -6, -7 - x, 
        If[-6 ≤ x ≤ -5, x + 5, 
          0]]
im2[x_] := 
      If[-7 ≤ x < -6, 7 + x, 
        If[-6 ≤ x ≤ -5, -5 - x, 
          0]]
f[x_] := (1/2) (s[x + t] + s[x - t] + im1[x + t] + 
            im1[x - t])
g[x_] := (1/2) (s[x + t] + s[x - t] + im2[x + t] + 
            im2[x - t])
+Table[
        Plot[f[x], {x, -10, 10}, 
          PlotRange -> {{-10, 10}, {-2, 2}}, 
          AxesLabel -> {"x", "u(x,t)"}, 
          PlotStyle -> {RGBColor[1, 0.6, 0], Thickness[0.015]}], {t, 0, 
          12, 0.1}]
Table[
      Plot[g[x], {x, -10, 10}, AxesLabel -> {"x", "u(x,t)"}, 
        PlotRange -> {{-10, 10}, {-2, 2}}, 
        PlotStyle -> {RGBColor[1, 0.6, 0], Thickness[0.015]}], {t, 0, 
        12, 0.1}]