Uniform boundedness of Fourier series of indicator functions Suppose $f\in L^1[0,2\pi]$, denote  by $S_n f(x)$ the partial sum of the Fourier series of $f$. I am interested in whether $S_nf(x)$ is uniformly bounded independent of $x$ and $n$, i.e.
$$(*)\ \ \ \ \sup_n\|S_n f\|_\infty<\infty.$$
For $f\in C[0,2\pi]$ with $f(0)=f(2\pi)$, it is a standard application of the uniform boundedness principle that $(*)$ may fail; see here.
For $f=\chi_{[a,b]}$, where $[a,b]\subset [0,2\pi]$, direct computation together with integration by parts shows that $(*)$ holds independent of $a$ and $b$. 
Now it seems natural to ask what happens if $f=\chi_E$, where $E\subset [0,2\pi]$ is a measurable set. More precisely, my questions is:
Question: Let $E\subset [0,2\pi]$ be a (Borel) measurable set and let $f=\chi_E$. Is it true that
$$\sup_n\|S_n f\|_\infty<\infty?$$
 A: There are counterexamples. Let $D_n$ be the Dirichlet kernel. Using the explicit formula for $D_n$, it is easy to see that for any $\delta>0$,
$$\sup_{n} \int_{|x|\ge \delta} |D_n(x)|\,dx  <\infty\tag1$$
$$\lim_{n\to\infty}\int_{|x|\le \delta} D_n(x)^+\,dx= \infty \tag2$$ As usual, $a^+=\max(a,0)$. 
Construct a positive sequence $\delta_m\searrow 0$, a sequence of sets $E_m\subset \{x:\delta_m \le|x|\le \delta_{m-1}\}$, and a sequence of indices $n(m)$ as follows.


*

*let $\delta_0=1$ 

*choose $n(1)$ so that $\int_{|x|\le \delta_0}D_{n(1)}^+\ge 2+\int_{|x|\ge \delta_{0}}|D_{n({1})}|$

*choose $\delta_1>0$ so that  $\int_{  |x|\le \delta_1}|D_{n(1)}|\le 1$ 

*let $E_1=\{x: \delta_1\le |x|\le \delta_0, \ D_{n(1)}(x)\ge 0\}$


Having $m-1$ of such things, continue:


*

*choose $n({m})$ so that $\int_{|x|\le \delta_{m-1}}D_{n({m})}^+\ge m+1+\int_{|x|\ge \delta_{m-1}}|D_{n({m})}|$

*choose $\delta_{m}>0$ so that  $\int_{|x|\le \delta_{m}}|D_{n({m})}|\le 1$ 

*let $E_{m}=\{x: \delta_{m}\le |x|\le \delta_{m-1}, \ D_{n({m})}(x)\ge 0\}$


Finally, let $E=\bigcup_{m=1}^\infty E_m$. For every $m$ we have 
$$S_{n(m)}\chi_E(0) = \int_E D_{n({m})} \ge \int_{E_{n(m)}} D_{n({m})} - \sum_{k\ne m} \int_{E_{n(k)}} |D_{n({m})}| \tag3$$
Here 
$$\int_{E_{n(m)}} D_{n_{m}} \ge m+1+\int_{|x|\ge \delta_{m-1}}|D_{n({m})}|$$
$$\sum_{k<m} \int_{E_{n(k)}} |D_{n({m})}| \le \int_{|x|\ge \delta_{m-1}}|D_{n({m})}|$$
$$\sum_{k>m} \int_{E_{n(k)}} |D_{n({m})}| \le \int_{|x|\le \delta_{m}}|D_{n({m})}|\le 1$$
and therefore $S_{n(m)}\chi_E(0)\ge m$. 
