a function that is in $L^2$ (the right version) Sorry I made a mistake when posting the last question. Actually my question is: can you give a  $f(x) $ such that $ f \in L^2 ( \mathbb R)$ but $  x^{-\frac{1}{2}} f \notin L^1 ( \mathbb R ) $. Thanks!

Take $$f(x)=\frac 1{\sqrt x\log x}\mathbf{\chi}_{[2,\infty)}(x).$$
Then $x\mapsto f^2(x)=(x\log^2x)^{-1}\mathbf{\chi}_{[2,\infty)}(x)$ is integrable and $x\mapsto x^{-1/2}f(x)=(x\log x)^{-1}\mathbf{\chi}_{[2,\infty)}(x)$ is not. 
