The Fourier transform shall be defined by
$$ \hat f(\xi) = \int_{-\infty}^{\infty} f(x) e^{-2\pi i \cdot \xi x} dx $$
The Fourier transform is well-defined for $f \in L^1(\mathbb R)$, that is, $f$ absolutely integrable, as can easily be checked.
However, we also know that the Fourier transform is well-defined for $f \in L^2(\mathbb R)$. In textbooks, this is usually shown by defined the Fourier transform over the Schwartz space and then taking the norm closure.
I am wondering whether there is an explicit and computable example of a function $f \in L^2(\mathbb R) \setminus L^1(\mathbb R)$ whose Fourier transform can be computed explicitly. Ideally, the example should be suitable for an undergraduate class, i.e., as simple as possible.
Let's look at the example $f(x)=\frac{\sin(x)}{x}$ as refernced in the comments. Clearly, $f\in L^2$ since
$$\begin{align} \int_{-\infty}^\infty\left|f(x)\right|^2\,dx&=\int_{|x|\le 1}\left|\frac{\sin(x)}{x}\right|^2\,dx+\int_{|x|\ge 1}\left|\frac{\sin(x)}{x}\right|^2\,dx\\\\ &\le \int_{-1}^1(1)^2\,dx+2\int_1^\infty \frac1{x^2}\,dx\\\\ &=4 \end{align}$$
Next, we show that $f\notin L^1$. Proceeding, let $f^+$ and $f^-$ denote the positive and negative parts of $f$, respectively. Then, we can write
$$\begin{align} \int_{-(2N+2)\pi}^{(2N+2)\pi}\left|f(x)\right|\,dx&=2\int_{0}^{(2N+2)\pi} |f(x)|\,dx\\\\ &=2\int_{0}^{(2N+2)\pi} (f^+(x)-f^-(x))\\\\ &=2\sum_{n=0}^N \left(\int_{2n\pi}^{(2n+1)\pi}\frac{\sin(x)}{x}\,dx\right)-2\sum_{n=0}^N \left(\int_{(2n+1)\pi}^{2(n+1)\pi}\frac{\sin(x)}{x}\,dx\right)\\\\ &\ge \sum_{n=0}^N \frac{4}{(2n+1)\pi}+\sum_{n=0}^N \frac{2}{n+1}\\\\ \end{align}$$
which clearly diverges as $N\to \infty$.
However, we have
$$\begin{align} \mathscr{F}\{f\}(\xi)&=\int_{-\infty}^\infty \frac{\sin(x)}{x}e^{-i2\pi \xi x}\,dx\\\\ &=\int_{-\infty}^\infty \frac{e^{i(1-2\pi \xi) x}-e^{i(1+2\pi \xi) x}}{i2x}\,dx\\\\ &=\int_{-\infty}^\infty \frac{\sin((1-2\pi \xi) x-\sin((1+2\pi \xi) x)}{2x}\,dx\\\\ &=\frac{\pi}{2}\left(\text{sgn}(1-2\pi \xi)-\text{sgn}(1+2\pi \xi)\right) \end{align}$$