Hi @Michael Rogers. I tried to use your statement after and also before the code.
rect[t_, T_] := HeavisideTheta[t + (T/2)] - HeavisideTheta[t - (T/2)]
x0[t_] := (1 + Cos@(2 Pi f0 t)) rect[t, T]
sum = Sum[x0@(t - n T), {n, -Infinity, Infinity},
Assumptions -> f0 > 0 && T > 0]
FourierCoefficient[sum, t, 0, FourierParameters -> {1, 2 Pi/T},
Assumptions -> f0 > 0 && T > 0]
FourierCoefficient[sum, t, 1, FourierParameters -> {1, 2 Pi/T},
Assumptions -> f0 > 0 && T > 0]
FourierCoefficient[sum, t, 2, FourierParameters -> {1, 2 Pi/T},
Assumptions -> f0 > 0 && T > 0]
oldFourierCoefficient /. f0 -> 1/(2 T)
In this case the output does not change. Actually Mathematica shows two outputs, the first is the same as before and the second is "oldFourierCoefficient".
Returning to the error that you noted about coefficient 1, after the (manual) substitution of f0=1/2T, the result is 2/(3 Pi). This is right, is the result of my professor.