ClearAll["Global`*"];
omega0 = 2.5; omega = 1.0; beta = 0.1; fampl = 1.0; fphi = 0.0; x0 = 3.0; v0 = 0.0; tmax = 100.0;
soln = NDSolveValue[{x''[t] + 2 beta x'[t] + omega0^2 x[t] == fampl Cos[omega t+fphi], x'[0]==v0, x[0]==x0}, x[t], {t, 0, tmax}];
Plot[{soln,fampl Cos[omega t + fphi]}, {t, 0, tmax}, PlotRange->All]

FourierSeries[Abs[t], t, 5]

Plot[%, {t, -3 Pi, 3 Pi}]

f[t_] := 1/2  + (2/Pi) (Sin[t] + Sin[3t]/3 + Sin[5t]/5);
Plot[f[t], {t, -10, 10}]

Integrate[t Exp[-I m w t], t]

f[t_] := 1/2 - (4/Pi^2)(Cos[t] + Cos[3t]/9 + Cos[5t]/25);
Plot[f[t], {t, -10, 10}]