$$f(x)=1, \text{ if } |x| < a \quad \text{ or }\quad f(x) = 0 \text{ if } \, |x| > a.$$
We use the formula $$ {1\over 2\pi} \int_{\infty}^\infty f(\bar x)e^{i\omega \bar x} $$ So is $f(\bar x)$ the same as $f(x)$ ?? In an answer they integrated form $-a$ to a however I thought it is from negative infinity to a since $0$ can not be integrated.
$$\int_{-\infty}^{\infty}f(x)e^{i\omega x}dx=\int_{-a}^{a}1\,e^{i\omega x}dx+\int_{|x|>a} 0\,e^{i\omega x}dx=2a\,\frac{\sin(\omega a)}{\omega a}$$
Note that the integral $\int_{|x|>a} 0\,e^{i\omega x}dx=0$.
Also note, that in the integral, the symbol $x$ is a "dummy" variable only. That is to say, we can replace $x$ with $\bar x$ as a dummy variable and the result retains.