\begin{align}
a_0 &= \frac{1}{2\pi}\int_{0}^{2\pi} \sin x \cdot \mathbf{I}_{[0,\pi]}\, dx = \frac{1}{2\pi}\int_{0}^{\pi} \sin x \, dx
= \frac{1}{\pi}\\
a_n &= \frac{2}{2\pi}\int_{0}^{2\pi} \sin x \cdot \mathbf{I}_{[0,\pi]} \cdot \cos\tfrac{2\pi n x}{2\pi}\, dx
= \frac{1}{\pi} \int_{0}^{\pi} \sin x \cdot \cos nx \, dx
= \frac{1}{\pi} \frac{\cos (\pi n) + 1}{1-n^2}\\
&= \frac{1}{\pi}\frac{1 + (-1)^n}{1-n^2}
= \begin{cases} \frac{2}{\pi}\frac{1}{1-n^2} & \text{if $n$ even}\\ 0 & \text{if $n$ odd}\end{cases}\\
b_n &= \frac{2}{2\pi}\int_{0}^{2\pi} \sin x \cdot \mathbf{I}_{[0,\pi]} \cdot \sin\tfrac{2\pi n x}{2\pi}\, dx
= \frac{1}{\pi} \int_{0}^{\pi}\sin x \cdot \sin (nx)\,dx\\
&= \frac{1}{\pi}\cdot\begin{cases}\tfrac{\pi}{2} & \text{if $n=1$}\\0 & \text{if $n>1$}\\\end{cases}
= \begin{cases}\tfrac{1}{2} & \text{if $n=1$}\\0 & \text{if $n>1$}\\\end{cases}
\end{align}
Hence the Fourier series of $f(x)$ over $(0,2\pi)$ is given by
\begin{align}
f(x) &\sim
a_0+\sum_{n=1}^{\infty}\left [a_n \cos (nx) + b_n\sin(nx)\right]\\
&= \frac{1}{\pi} + \sum_{n=1}^{\infty}\frac{2}{\pi}\frac{1}{1-(2n)^2}\cos((2n)x) + \frac{1}{2}\sin((1)x)\\
&= \frac{1}{\pi} + \frac{2}{\pi}\sum_{n=1}^{\infty}\frac{\cos(2nx)}{1-4n^2} + \frac{1}{2}\sin(x)
\end{align}
Plotted with 20 terms using Wolfram Alpha:
Note
I used Wolfram Alpha to compute these integrals, but it skipped the special case of $b_1$. This is likely to do with a symbolic division that implicitly assumed $n\neq 1$. Either way, this special case follows near-directly from the principle of orthogonality, i.e.,
$$
\frac{1}{\pi}\int_0^{2\pi} \sin(nx)\sin(mx)\,dx = \begin{cases}1 &\text{if $n=m$}\\
0 & \text{if $n\neq m$}\end{cases}
$$
So in our case, $$\frac{1}{\pi} \int_0^{2\pi} \sin(x)\mathbf{I}_{(0,\pi)}\sin(nx)\,dx
= \frac{1}{\pi} \begin{cases} \int_0^{\pi} \sin(x)^2\,dx & \text{for $n=1$}\\
\int_0^{\pi} \sin(x)\sin(nx)\,dx & \text{for $n>1$}\end{cases}$$
This latter point highlights why I knew that Wolfram Alpha hadn't given me everything,
$$\int_{0}^a \sin(x)^2 \,dx > 0,\quad\text{for $a>0$}$$
so we wouldn't expect the corresponding coefficient to be zero. If, on the other hand, the function were something like $f(x)=\sin(5x)\cdot \mathbf{I}_{(0,\pi)}$ or $f(x)=\cos(2x)\cdot \mathbf{I}_{(0,\pi)}$, then we'd know to check $b_5$ or $a_2$ respectively.
If you have learned about vector spaces, then you can think of the integral as an dot (inner) product over vectors $1, \sin(nx),\cos(nx)$ for $n=1,\dotsc,\infty$. The inner product measures similarity. In this case we are asking about amount of "$sin(x)$"-ness if we take a $\sin(x)$ function and lop off the latter half. The answer, perhaps unsurprisingly, is a half.
Best Answer
First, your function considered on each of the intervals $[0,T/2[$ and $[-T/2,0[$ separately, is just a constant function. It's the whole that is non-constant. So, when you integrate, since you can separate out your integration over the different integration intervals, on them, you are just integrating a constant function.
So, $f$ didn't disappear, $f$ is just equal to $1$ over the interval $[0,T/2[$.
Second, your function is also odd. The constant term is found by simply integrating the function over an interval symmetric around the origin.
$$a_0=\frac{2}{T}\int_{t=-\frac{T}{2}}^{t=\frac{T}{2}}f(t)\,\mathrm{d}t=\frac{2}{T}\int_{t=-\frac{T}{2}}^{t=0}f(t)\,\mathrm{d}t+\frac{2}{T}\int_{t=0}^{t=\frac{T}{2}}f(t)\,\mathrm{d}t \\ =\frac{2}{T}\int_{t=-\frac{T}{2}}^{t=0}-1 \, \,\mathrm{d}t+\frac{2}{T}\int_{t=0}^{t=\frac{T}{2}} 1 \, \,\mathrm{d}t = 0 \; .$$
Therefore the integral is zero.
EDIT: $$\begin{eqnarray}\int_{t=-\frac{T}{2}}^{t=\frac{T}{2}}f(t)\,\mathrm{d}t & = & \int_{t=-\frac{T}{2}}^{t=\frac{T}{2}} \left(\frac{a_0}{2}+ \sum_{r=1}^{r=\infty} a_r\cos\frac{2\pi r t}{T}+b_r\sin\frac{2\pi r t}{T}\right)\,\mathrm{d}t\\ & = & \int_{t=-\frac{T}{2}}^{t=\frac{T}{2}} \frac{a_0}{2}\,\mathrm{d}t+ \sum_{r=1}^{r=\infty} a_r \int_{t=-\frac{T}{2}}^{t=\frac{T}{2}}\cos\frac{2\pi r t}{T}\,\mathrm{d}t+\sum_{r=1}^{r=\infty}b_r\int_{t=-\frac{T}{2}}^{t=\frac{T}{2}} \sin\frac{2\pi r t}{T}\,\mathrm{d}t \\ & = & \int_{t=-\frac{T}{2}}^{t=\frac{T}{2}} \frac{a_0}{2}\,\mathrm{d}t+ \sum_{r=1}^{r=\infty} a_r \cdot 0+\sum_{r=1}^{r=\infty}b_r\cdot 0 \\ & = & \int_{t=-\frac{T}{2}}^{t=\frac{T}{2}} \frac{a_0}{2}\,\mathrm{d}t \\ & = & \frac{a_0}{2}\cdot T \end{eqnarray}$$