Suppose this is the data we want to interpolate, namely f evaluated at the nodes x0 = 0, x1 = 1, x2 = 2, and x3 = 3.

f[x_] = 1./(1+x^2);
data = Table[{x, f[x]}, {x, 0, 3, 1}];
TableForm[data, TableHeadings ->{None, {x,y}}]
Magnify[Plot[f[x], {x, 0, 3}, Epilog -> Point[data], ImageSize -> 200], 1.3]

The Linear Spline interpolating f is given by a piecewise-defined function.  Figure out the constants a0, a1, a2, b0, b1 and b2 to make the linear spline continuous and agree with f at the nodes 0, 1, 2, and 3.

S0[x_] := a0 +b0 x
S1[x_] := a1 +b1(x-1)
S2[x_] := a2 +b2(x-2)
S[x_] := Which[ (* Which outputs the thing following the first True boolean *)
x < 1, S0[x],
x < 2, S1[x],
x < 3, S2[x]
]
Magnify[Plot[{f[x], S[x]}, {x, 0, 3}, Epilog -> Point[data], ImageSize -> 200], 1.3]