f[x_] = Abs[x];
Plot[f[x], {x, -1, 1}]

Clear[data];
data= Table[{0.2 i,f[0.2 i]},{i,-5, 5}];
Clear[g,Q];
g[x_]= InterpolatingPolynomial[data, x];
Q[x] = Expand[g[x]]

dots = ListPlot[data,PlotStyle->
   {PointSize[0.02]},
    DisplayFunction->Identity];
g1=Plot[{f[x], g[x]}, {x, -1.1,1.1},
DisplayFunction->Identity];
Show[g1,dots,PlotRange->{{-1.1,1.1},
 {-0.2,1.5}},
PlotLabel->"n=10: |x| and the interpolating polynomial.",
AxesLabel->{"x","y"},DisplayFunction->$DisplayFunction];

Clear[data];
data= Table[{0.1 i, f[0.1 i]},{i, -10, 10}] ;
Clear[g,Q];
g[x_]= InterpolatingPolynomial[data, x];
Q[x] = Expand[g[x]];
dots = ListPlot[data,PlotStyle->
  {PointSize[0.02]},
   DisplayFunction->Identity];
g1=Plot[{f[x], g[x]}, {x, -1.1,1.1},
DisplayFunction->Identity];
Show[g1,dots,PlotRange->{{-1.01,1.01},
 {-1.1,2}},
PlotLabel->"n=20: |x| and the interpolating polynomial.",
AxesLabel->{"x","y"},DisplayFunction->$DisplayFunction];

Clear[data];
data= Table[{Cos[(2i+1) Pi /20]//N, 
f[Cos[(2i+1) Pi /20]//N]},{i, 0, 9}];
Clear[g,Q];
g[x_]= InterpolatingPolynomial[data, x];
Q[x] = Expand[g[x]];
dots = ListPlot[data,PlotStyle->
   {PointSize[0.02]},
    DisplayFunction->Identity];
g1=Plot[{f[x], g[x]}, {x, -1.1,1.1},
DisplayFunction->Identity];
Show[g1,dots,PlotRange->{{-1.1,1.1},{-0.05,1.05}},
PlotLabel->"n=10: |x| and the interpolating polynomial.",
AxesLabel->{"x","y"},DisplayFunction->$DisplayFunction];

Clear[data];
data= Table[{Cos[(2i+1) Pi /40]//N, 
f[Cos[(2i+1) Pi /40]//N]},{i, 0, 19}];
Clear[g,Q];
g[x_]= InterpolatingPolynomial[data, x];
Q[x] = Expand[g[x]];
dots = ListPlot[data,PlotStyle->
  {PointSize[0.02]},
   DisplayFunction->Identity];
g1=Plot[{f[x], g[x]}, {x, -1.1,1.1},
DisplayFunction->Identity];
Show[g1,dots,PlotRange->{{-1.1,1.1},{-0.05,1.05}},
PlotLabel->"n=20: |x| and the interpolating polynomial.",
AxesLabel->{"x","y"},DisplayFunction->$DisplayFunction];