Square wave autocorrelation integral
It should not be difficult to verify that \$R(\alpha) \$ is periodic with period \$T\$. Here, the value of \$ R_1(\alpha) = T- 4\alpha  \$ looks correct, for \$ R_2(\alpha) \$ I calculate it to be \$4\alpha - 3T\$. Both \$R_1,\ R_2\$ define \$R(\alpha)\$ over one period, as \$R_1\$ is defined for \$0&lt;\alpha&lt;T/2\$ whereas \$R_2\$ is for \$T/2&lt;\alpha&lt;T\$. 

EDIT: Here, let \$T_p\$ is the period of the your signal \$g(t)\$. Using Wikipedia, we get $$R(\alpha)=\lim _{T\to \infty}T^{-1} \int_0^{T} g(t)g(t-\alpha)dt.$$ Now this can simplified by the periodicity of the your signal \$g(t)\$ to give $$R(\alpha) =\lim _{T\to \infty}T^{-1}\sum_{k=0}^{k=T/T_p-1} \int_{k T_p}^{(k+1)T_p} g(t)g(t-\alpha)dt. $$ Now since the integral is periodic over a period \$T_p\$ we get $$R(\alpha) = T_p^{-1} \int_0^{T_p}g(t)g(t-\alpha)dt.$$

Upto a constant factor this matches with the definition you used.