Prove that $f(x)e^{-inx}$ is integrable if $f$ is Riemann integrable. 
My attempt:
$$\left|\int_{-\pi}^{\pi}f(x)e^{-inx}\right|dx\leq  \int_{-\pi}^{\pi}\left|f(x)e^{-inx}\right| dx= \int_{-\pi}^{\pi}|f(x)||e^{-inx}|dx= \int_{-\pi}^{\pi}|f(x)|dx\leq\infty. $$
It is my attampt is the sense that I can write it. But I dont understand several things.
Question 1: We know that $f$ is integrable by Riemann. Then $|f|$ is also integrable by Riemann in any case?
Question 2: In the above question if we replace "by Riemann" by "by Lebesgue" the answer will be the same?
Question 3: We was asked to prove that $f(x)e^{-inx}$ is integrable  by Riemann. Why we use absolute value? For me it looks like we do this just because we want to use a well-known inequlity $|\int f |\leq \int |f|$ for the sake of the proof.
Question 4: Okey. Now we know that $\int_{-\pi}^{\pi}|f(x)e^{-inx}|dx \leq \infty$. In other words  $ |f(x)e^{-inx}|$ is integrable. Can we conclude that  $f(x)e^{-inx}$ is also integrable by Riemann in any case?
 A: The answer is yes to Riemann and Lebesgue integrals, though for different reasons: Your reasoning works for the Lebesgue integral since (with a measurability assumption as background) integrability is all about controlling the size of the function. On the other hand, for the Riemann integral you also have to worry about irregularities: For instance the function
$$
f(x)=
\begin{cases}
1 & x\in \mathbb{Q},\\
-1 & x\in \mathbb{R}\setminus\mathbb{Q},
\end{cases}
$$
is not Riemann integrable, but $|f|$ is. So it's not all about the size for the Riemann integral.
Nonetheless you have nice properties of the Riemann integral such as: If $f,g$ are Riemann integrable, then so is $f\cdot g$. One way to see this is to write $2f\cdot g= (f+g)^2-f^2-g^2$, and then prove the result for $f=g$. Once we have this the result you want is immediate since $g(x)=e^{-inx}$ is continuous (in particular integrable).
So to answer your questions:

*

*Yes, this is true. This follows from the definition of integral as the limit of upper and lower sums and the triangle inequality.


*Yes, and as I mentioned above, your proof goes through in that case.


*Again see my first paragraph.


*No, see above for a counterexample.
A: Answer 1: As explained with the standard example in the comments, it is not true in any case. But here it holds since $f$ Riemann integrable implies $|f|$ Riemann integrable on a compact set (seen as composition of riemann integrable function with a continuous function).
Answer 2: Since we are on a closed and bounded interval, Riemann integrablilty implies Lebesgue integrability, so all works there too.
Answer 3: By answer 2, you can just work with Lebesgue integral and showing that the integral of your function $g$ is finite. Hence, using your majorization you get the result.
Answer 4: Nope, the converse of answer 2 does not hold.
A: Somewhere along the way you learned that the product of two Riemann integrable (RI) functions is RI. Here we have $f$ which is RI, and $e^{in\theta},$ which is continuous and hence RI. Therefore $f(\theta)\cdot e^{in\theta}$  is RI.
