I was looking for an example of an operator on a Hilbert space which is not closed. This is what I have done so far, but am not sure if the proof is alright.
Consider $H=L^{2}[0,1]$ and $T$ defined as follows: $D(T)=C^{\infty}[0,1]$, $Tf=f'$.
I show that $T$ is not closed by showing that $T^{**}$ is a proper (closed) extension of $T$.
We show first that $\{g\in L^{2}[0,1]:g\text{ absolutely continuous}, g'\in L^{2}, g(0)=0=g(1)\}$ is contained in $D(T^{*})$. This follows since $|<Tf,g>|=|\int_{0}^{1}f'\bar{g}|=|\int_{0}^{1}\bar{g}'f|=|<T\bar{g},f>|\leq\|T\bar{g}\|\|f\|$ for all such $g$, and for $f\in D(T)$. Hence we also have that $D(T^{*})$ is dense in $L^{2}[0,1]$ and hence $T^{**}$ is well-defined.
We consider an absolutely continuous function $f\in L^{2}$ with $f'\in L^{2}$ and $f(0)=0=f(1)$, but $f$ not infinitely differentiable. Then $f\in D(T^{**})$ but not in $D(T)$, whence $ is not closed.
What is an example of such a function? Is this proof alright?
Take for instance $f(x)= \min(x, 1-x)$. Then $f$ has the properties you are asking for.