Suppose the functions $a,f \in C(\mathbb{R} \rightarrow \mathbb{R})$ are both periodic with period $\omega.$ There are three parts for this question. I'm still trying to figure out the first part. Show that $x'+a(t)x=f(t),$ has a unique $\omega$-periodic solution if and only if $\displaystyle{\int_{0}^{\omega} a(t)~dt \neq 0}.$
My approach: Since both $a,f \in C(\mathbb{R} \rightarrow \mathbb{R})$ are periodic with period $\omega,$ we have $a(t+\omega)=a(t), f(t+\omega)=f(t)$ for all $t \in \mathbb{R}.$ \
$``\Rightarrow"$: Suppose that the given equation has a unique $\omega$-periodic solution. Multiplying it throughout by the I.F. $\displaystyle{e^{\int_{0}^{\t} a(t)~dt}}$ yields $$\frac{d}{dt}\left( x(t) \cdot e^{\int_{0}^{t} a(s)~ds} \right)=f(t) e^{\int_{0}^{t} a(s)~ds}.$$ $$\Rightarrow x(t)=e^{-\int_{0}^{t} a(s)~ds} \cdot \int_{0}^{t} f(u) e^{\int_{0}^{u} a(s)~ds}~du.$$ From the periodicity, $x(t)=x(t+\omega),$ $$\int_{0}^{t} f(u) e^{\int_{0}^{u} a(s)~ds}~du = e^{-\int_{t}^{t+\omega} a(s)~ds} \cdot \bigg\{ \int_{0}^{t} f(u) e^{\int_{0}^{u} a(s)~ds}~du+\int_{t}^{t+\omega} f(u) e^{\int_{0}^{u} a(s)~ds}~du \bigg\}.$$ $$\Rightarrow \left( 1 - e^{-\int_{t}^{t+\omega} a(s)~ds} \right) \cdot \int_{0}^{t} f(u) e^{\int_{0}^{u} a(s)~ds}~du = e^{-\int_{t}^{t+\omega} a(s)~ds} \cdot \int_{t}^{t+\omega} f(u) e^{\int_{0}^{u} a(s)~ds}~du.$$
I've gotten only upto this far. I need help in solving this. Thank you.
You are missing the initial value in the solution formula. With that you get $$ (e^{A(t)}x(t))'=e^{A(t)}f(t)\implies e^{A(t)}x(t)-x(0)=\int_0^t e^{A(s)}f(s)\,ds $$ and using periodicity $$ e^{A(ω)}x(ω)-x(0)=(e^{A(ω)}-1)x(0) =\int_0^ω e^{A(s)}f(s)\,ds $$ and you only get a value for $x(0)$ if $e^{A(ω)}-1\ne 0\iff 0\ne A(ω)=\int_0^ωa(s)\,ds$.
In the other direction, if $x(ω)=x(0)$ then by uniqueness $x(t+ω)=x(t)$ for all $t$ which implies periodicity.