TITLE: $L^{2}$ functions
QUESTION [5 upvotes]: Let $f(x)$ be a continuous function for all $x\in \mathbb R$, such that $f\in L^{2}(\mathbb R)$ (i.e., $\int_{-\infty}^{\infty}|f(x)|^{2}dx<\infty$), and define $$f_{o}(x):=\sup_{|x-y|\leq 1}|f(y)|$$
How to prove that $f_{o}\in L^{2}(\mathbb R)$, and $\|f_{o}\|_{L^{2}}\leq A\|f\|_{L^{2}}$, for some constant $A>0$?

My progress is the follwoing, so correct me if I'm wrong, and advise me if I'm missing something:

We can construct a function $g\in S(\mathbb R)$ (Schwartz class) with $\hat{g}=1$, so $\hat{f}=\hat{f}\hat{g}$, hence $f=f*g$ (convolution), then
$$f_{o}(x)\leq (|f|*g_{o})(x)$$ 
which implies that $\|f_{o}\|_{L^{2}}\leq \|(|f|*g_{o})\|_{L^{2}}\leq \|f\|_{L^{2}} \|g_{o}\|_{L^{1}}$.

REPLY [2 votes]: I think this statement is not true. Consider sequences 
$$
a_n=n\qquad b_n=\frac{a_n+a_{n+1}}{2}
$$
and define functions
$$
f_n(x)=
\begin{cases}
0 & x<b_{n-1}\\
\left(\frac{x-b_{n-1}}{a_n-b_{n-1}}\right)^{n^2+1} & b_{n-1}\leq x<a_n\\
\left(1-\frac{x-a_{n}}{b_n-a_n}\right)^{n^2+1} & a_n\leq x<b_n\\
0 & x \geq b_n
\end{cases}
$$
Now we define function $f(x)=\sum\limits_{n=-\infty}^\infty f_n(x)$. Its graph consist of uniformly disturbed peaks centered at integer points. Peaks become more sharp as $n$ tends to infinity.

We choose peaks sharp enough in order to $f\in L^2(\mathbb{R})$. One can show that $f$ is continuous and
$$
\Vert f\Vert_{L^2}=\left(\sum\limits_{n=-\infty}^\infty\frac{1}{1+2n^2}\right)^{1/2}<+\infty
$$
Since for all $x\in\mathbb{R}$ we have $0\leq f(x)\leq 1$ and for all $n\in\mathbb{Z}$ we have $f(n)=1$, then for all $x\in\mathbb{R}$
$$
f_o(x)=1
$$
Obviously, $f_o\notin L^2(\mathbb{R})$.