Plot[Piecewise[{{Cos[\[Pi]/2 + x/2], x < \[Pi]}, {Cos[x], x >= \[Pi]}}],{x,0,2Pi}]