The delta function can be defined as follow:
$$\delta (x) = \frac{1}{2\pi} \int dk e^{ikx}$$
I am trying to prove that $\delta$ is equal to $0$ for $x\neq 0$
So I tried to replace the integral over infinity by an integral between $K$ and $-K$ (and then take the limit $K\rightarrow \infty$)
Let $x\neq 0$,
$$\delta(x) = \lim_{K \to \infty} \frac{e^{iKx} - e^{-iKx}}{2\pi ix}$$
$$ = \lim_{K \to \infty} \frac{2sin(Kx)}{2\pi x}$$ $$ = \lim_{K \to \infty} \frac{Ksin_c(Kx)}{\pi }$$
But this doesn't seem to converge to $0$.
Where is the error? Isn't it OK to replace the infinite integral with $K$ variable bound ? Or did I go wrong somewhere else? This delta function is puzzling me
The "delta function" is not a function. In particular there is no such thing as $\delta(x)$ for $x\in\Bbb R$, so that integral formula at the start is nonsense.
There are true facts analogous to that intgeral formula and to what you're trying to prove, but we need to be much more careful about the definitions.
Say $V=\Bbb R\setminus\{0\}$.
That does not mean that $\delta(x)=0$ for all $x\in V$; that's nonsense. It means that $\langle\delta,\phi\rangle:=\phi(0)=0$ for all smooth $\phi$ supported in $V$.
And now for each $k$ let $e_k$ be the tempered distribution corresponding to the function $e^{ikx}$: $$\langle e_k,\phi\rangle:=\int\phi(x)e^{ikx}\,dx.$$
What that means is explained by saying it's a vector-valued, in particular an $\mathscr S'(\Bbb R)$-valued, integral. What that means in turn is a long story, sorry. But TF 2 definitely does not mean $$\delta(k)=\frac1{2\pi}\int e^{ikx}\,dx.\quad(*)$$Someone somewhere wanted to state TF 2, but explaining what it actually means was too advanced, so they settled for (*) instead. They lied when they did that.