So I was trying to think of examples of function $\psi\in L^2(\mathbb{R})$ such that $i\frac{d}{dx}\psi \notin L^2(\mathbb{R})$.
Could someone give such an example pls?
My attempt on this problem is to consider a function $\psi(x)=\frac{1}{|x|}$ such that $x\psi(x)$ is not square-integrable. And then I consider the inverse fourier-transform of $\hat{\phi}(p):=\psi(p)$ but find it difficult to evaluate$$\int_{\mathbb{R}}\frac{1}{|p|}e^{ipx}dp$$ However clearly this attempt is wrong as we have defined $$L^2(\mathbb{R})=\mathcal{L}^2(\mathbb{R})/\mathcal{N}(\mathbb{R})$$ to fix the issue on norm. Here $$\mathcal{N}(\mathbb{R})=\{f\in \mathcal{L}(\mathbb{R}),f=0~\text{almost everywhere} \}$$.
You are just trying to find a function that is not very regular. For example a function with a jump works, $$ f(x) = \mathbf 1_{[0,1]} = \left\{\begin{aligned} &1 \text{ if } x\in[0,1] \\ &0 \text{ else } \end{aligned}\right. $$ since its derivative in the sense of distributions is $f' = \delta_0-\delta_{-1}$ (or if you prefer, its classical derivative is not defined at the discontinuity points). Of course, $f\in L^2$.