f=Interpolation[{{0,1},{1,2},{3,0},{2.5,Pi-1}}, InterpolationOrder -> 1]

Plot[f[x], {x,0,4}]