First of all we observe that the period $T$ can be suppose not negative without loss of generality: indeed if $T$ was not positive then $-T$ would be not negative and it would be such that
$$
f(x-T)=f\big((x-T)+T\big)=f(x)
$$
for any $x\in\Bbb R$. So without loss of generality we can suppose that
$$
x\le x+T
$$
for any $x\in\Bbb R$ so that the function $F:\Bbb R\rightarrow\Bbb R$ defined as
$$
F(x):=\int_x^{x+T}f(t)\,dt
$$
for any $x\in\Bbb R$ is well defined.
So we let to prove now that $F$ is constant and precisely we are doing this proving that it is constant in $(-\infty,T]$ and in $[T,+\infty)$ respectively.
Previously we remember that the Change of Variables Theorem states that
Given a diffeomorphism $\phi:A\rightarrow B$ between open sets of $\Bbb R^n$ for any $C^r$ function $f:A\rightarrow\Bbb R$ with $r\ge 1$ the identity $$\int_Af=\int_B(f\circ \phi)|\det Dg|$$ holds.
whereas the Fundamental Theorem of Calculus states that
If $I$ is a (closed) interval of the real line $\Bbb R$ with extremities $x_1$ and $x_2$ then given a real valued function $f:I\rightarrow\Bbb R$ the function $F:I\rightarrow\Bbb R$ defined as
$$
F(x):=\int_{[x_1,x]}f(\xi)\,d\xi
$$
for any $x\in I$ is derivable in $I$ and it is such that
$$
\operatorname{D}F(x)=f(x)
$$
for any $x\in I$.
- So let be now $x\in(T+\infty]$ and thus through the additivity of the integral we observe that
$$
F(x):=\int_{[x,x+T]}f(t)\,dt=\int_{[T,x+T]\setminus[T,x]}f(t)\,dt=\int_{[T,x+T]}f(t)\,dt-\int_{[T,x]}f(t)\,dt
$$
for any $x\in[T,+\infty)$. Now let be $\varphi:\Bbb R\rightarrow\Bbb R$ the diffeomorphism defined through the equation
$$
\varphi(x):=x+T
$$
for any $x\in\Bbb R$. So through the Chain Rule we conclude that
$$
\operatorname{D}F(x)=D\Biggl[\int_{\big[T,\varphi(x)\big]}f(t)\,dt-\int_{[T,x]}f(t)\,dt\Biggl]=\\
\operatorname{D}\Biggl[\int_{\big[T,\varphi(x)\big]}f(t)\,dt\Biggl]\cdot\operatorname{D}\varphi(x)-\operatorname{D}\Biggl[\int_{[T,x]}f(t)\,dt\Biggl]=\\
f\big(\varphi(x)\big)-f(x)=f(x+T)-f(x)=0
$$
for any $x\in[T,+\infty)$ and so the statement is proved for this such $x$.
- So let be now $x\in(-\infty,T]$ and provided that $x$ is not negative through the additivity of the integral we observe that
$$
F(x):=\int_{[x,x+T]}f(t)\,dt=\int_{[x,T]\cup[T,x+t]}f(t)\,dt=\int_{[x,T]}f(t)\,dt+\int_{[T,x+T]}f(t)\,dt
$$
Now let be $\phi:\Bbb R\rightarrow\Bbb R$ the diffeomorphism defined through the equation
$$
\phi(x):=-x
$$
for any $x\in\Bbb R$ so that through the change variables theorem we conclude that
$$
F(x)=\int_{[x,T]}f(t)\,dt+\int_{[T,x+T]}f(t)\,dt=\int_{(x,T)}f(t)\,dt+\int_{(T,x+T)}f(t)\,dt=\\
\int_{\phi^{-1}\big[(x,T)\big]}\big(f\circ\phi\big)(t)\cdot\Big|\operatorname{det}\big(\operatorname{D}\phi(t)\big)\Big|\,dt+\int_{\big(x,\varphi(x)\big)}f(t)dt=\\
\int_{(-T,-x)}\big(f\circ\phi\big)(t)\,dt+\int_{\big(T,\varphi(x)\big)}f(t)\,dt=\int_{\big(-T,\phi(x)\big)}\big(f\circ\phi\big)(t)\,dt+\int_{\big(T,\varphi(x)\big)}f(t)\,dt
$$
for any $x\in[0,T]$ and thus finally through the Fundamental Theorem of Calculus and through the Chain Rule we conclude that
$$
\operatorname{D}F(x)=
\operatorname{D}\Biggl[\int_{\big(-T,\phi(x)\big)}\big(f\circ\phi\big)(t)\,dt+\int_{\big(T,\varphi(x)\big)}f(t)\,dt\Biggl]=\\
D\Biggl[\int_{\big(-T,\phi(x)\big)}\big(f\circ\phi\big)(t)\,dt\Biggl]\cdot\operatorname{D}\phi(x)+\operatorname{D}\Biggl[\int_{\big((T,\varphi(x)\big)}f(t)\,dt\Biggl]\cdot\operatorname{D}\varphi(x)=\\
-\Big(f\circ\phi\Big)\big(\phi(x)\big)+f\big(\varphi(x)\big)=f\big(\varphi(x)\big)-f\Big(\phi\big(\phi(x)\big)\Big)=f(x+T)-f(x)=0
$$
for any $x\in[0,T]$ so that we proved that $F$ is effectively constant on the not negative real line. Whereas if $x$ is not positive through the additivity of the integral we observe that
$$
F(x):=\int_{[x,x+T]}f(t)\,dt=\int_{[x,T]\setminus[x+T,x]}f(t)\,dt=\int_{[x+T]}f(t)\,dt-\int_{[x+T,x]}f(t)\,dt
$$
for any $x\in(-\infty,0]$ so that through the change variables theorem we conclude that
$$
F(x)=\int_{[x,T]}f(t)\,dt-\int_{[x+T,T]}f(t)\,dt=\\
\int_{\phi^{-1}\big[[x,T]\big]}(f\circ\phi)(t)\,dt-\int_{\phi^{-1}\big[[x+T,T]\big]}(f\circ\phi)(t)\,dt=\\
\int_{[-T,-x]}(f\circ\phi)(t)\,dt-\int_{[-T,-(x+T)]}(f\circ\phi)(t)\,dt
$$
for any $x\in(-\infty,0]$ and thus finally through the Fundamental Theorem of Calculus and through the Chain Rule we conclude that
$$
DF(x)=D\Biggl[\int_{[-T,-x]}(f\circ\phi)(t)\,dt-\int_{[-T,-(x+T)]}(f\circ\phi)(t)\,dt\Biggl]=\\
D\Biggl[\int_{[-T,\phi(x)]}(f\circ\phi)(t)\,dt-\int_{[-T,(\phi\circ\varphi)(x)]}(f\circ\phi)(t)\,dt\Biggl]=\\
D\Biggl[\int_{[-T,\phi(x)]}(f\circ\phi)(t)\,dt\Biggl]\cdot D\phi(x)-D\Biggl[\int_{[-T,(\phi\circ\varphi)(x)]}(f\circ\phi)(t)\,dt\Biggl]\cdot D(\phi\circ\varphi)(x)=\\
-(f\circ\phi)(\phi(x))-\Big(-(f\circ\phi)\Big(\big(\phi\circ\varphi\big)(x)\Big)\Big)=\\
f\big(\varphi(x)\big)-f(x)=f(x+T)-f(x)=0
$$
for any $x\in(-\infty,0]$ and this proves finally that $F$ is constant in $(-\infty,0]$ too.