# Show there is some continuous, $2\pi$ periodic function $h$ such that $||f-h||_2<\epsilon$

Suppose $f$ is a Riemann integrable function. Show there is some continuous, $2\pi$ periodic function $h$ such that $\|f-h\|_2<\epsilon$.

Attempt/Thoughts:

Assume $f$ is Riemann integrable. Then we can define a step function on the partition intervals $(x_{\delta},x_{\delta +1})$ that approximates $f$. I'm not sure how I can make such a function continuous or $2\pi$ periodic though.

Any hints are welcome. Thanks.

• What is the domain of $f$? – copper.hat Jan 12 '15 at 17:54
• Presumably you have in mind the function $f$ is being approximated on $[0,2\pi]$, when you apply the $2$-norm $||f-h||_2$. – hardmath Jan 12 '15 at 17:55
• Just checking... – copper.hat Jan 12 '15 at 17:55
• Heh, I was posting when you were... – hardmath Jan 12 '15 at 17:56
• @copper.hat: the domain is $[-\pi,\pi]$ – Sujaan Kunalan Jan 12 '15 at 17:58

Suppose $f:[a,b] \to \mathbb{R}$ is integrable, with $|f(x)| \le M$ for some $M$, and $f$ is continuous on some open (relative to $[a,b]$) interval $I \subset [a,b]$, except at some point $c \in I$. Then, for any $\epsilon>0$ and any $y$ such that $|y|\le M$, we can find some function $\tilde{f}$ such that (i) $\tilde{f}(x) = f(x)$ for $x \notin I$, (ii) $\tilde{f}$ is continuous on $I$, (iii) $|\tilde{f}(x)| \le M$ (iv) $\|f-\tilde{f}\| < \epsilon$ and (v) $\tilde{f}(c) = y$.
If $c \in (a,b)$, choose $x_1,x_2 \in I$ such that $x_1 < c < x_2$ and $|x_2-x_1| < ({1 \over 2M} \epsilon)^2$. Let $\tilde{f}(x) = \begin{cases} f(x_1)+ {x-x_1 \over c - x_1} (y-f(x_1)), & x \in [x_1,c] \\ c+ {x-c \over x_2 - c} (f(x_2)-c), & x \in [c,x_2] \\ f(x), & \text{otherwise}\end{cases}$. Then $\tilde{f}$ is continuous on $I$, equal to $f$ everywhere else, bounded by $M$ and $\|f-\tilde{f}\| = \sqrt{\int_{[x_1,x_2]}|f(x)-\tilde{f}(x)|^2 dx} < \epsilon$.
If $c=a$ or $c=b$, it should be clear how to modify the above accordingly.