Fourier series: Understanding a proof, if $\int_0^{2\pi} f(x)e^{i(n+\frac{1}{2})x} dx = 0$ prove that $f(x)=0$. 
Let $f:[0,2\pi]\to\mathbb{R}$ is continuous, such that for all $n\in\mathbb{Z}$:$$\int_0^{2\pi} f(x)e^{i(n+\frac{1}{2})x} dx = 0$$ Prove that $f(x)=0$.

The solution:
We can rewrite the integral as:
$$\int_0^{2\pi} f(x)e^{i(-n-\frac{1}{2})x} dx = 0$$
We define $g(x) = f(x)e^{\frac{-ix}{2}}$.
It turns out that the Fourier coefficients of $g(x)$, are zeroes (for every $n$: $\hat{g}(n) = 0$). 
Therefore, the Fourier series is a series of zeroes which converges uniformly.
Hence, $g\equiv 0$ which implies $f(x) = 0$ ($g$ is continuous and the Fourier series converges to $g$).
Question:
I really want to understand how can one reach this solution? What are the thought that should come up in my mind in order to solve it?
By the way, is there a good alternative approach you would take?
Thanks.
 A: 1. Step: Understand what a Fourier Series is
The Fourier series representation of a continuous function $f:[0,2\pi]\rightarrow \mathbb R$ is given by
$$ f(x) = \sum_{n=-N}^N c_n\cdot e^{i nx},$$
where $c_n$ are the Fourier coefficients given by.
$$c_n := \frac{1}{2\pi}\int_{0}^{2\pi} f(x)\cdot e^{-inx}\ dx$$
2. Step: Recognize the function and its coefficients in your particular problem
The only creativity needed to solve the problem is to see that you are given the Fourier coefficients of the function $x\mapsto f(x)e^{\frac{ix}{2}}$:
$$0 = \int_0^{2\pi} f(x)e^{i(n+\frac{1}{2})x} dx = \int_{0}^{2\pi} \left(f(x)e^{\frac{ix}{2}}\right)\cdot e^{-i(-n)x}\ dx=2\pi\;c_{-n}$$
3. Step Calculate the Fourier Series of $x\mapsto f(x)e^{\frac{ix}{2}}$ and conclude
Because $f$ and therefore $f(x)e^{\frac{ix}{2}} $ is continuous, it can be calculated by its Fourier series. As all $c_n$ are zero, we get $ f(x)e^{\frac{ix}{2}} = 0$ which implies $f=0$ (the exponential function is never zero).
Concerning your other questions 
There are no meaningful alternative proofs.
The proof as writen in your question actually has an error in it. It should be $g(x)=f(x)e^{\frac{ix}{2}}$. Furthermore, uniform convergence is not needed and does not make sense here.
