I will reuse a former answer of mine too: Proof of complex conjugate symmetry property of DFT. It relates to how sines and cosines can be defined. One answer is: from the exponential, and thus derives $\pi$. There exist other constructions, this one is (imho) elegant.
The periodicity of the cosine comes from the fact it is defined as the real part of the cisoid, or complex exponential, $e^{ix}$.
In W. Rudin's Real and Complex analysis (very first pages, 1 to 3 of the prologue), $e$ comes first, and $\pi$ appears subsequently.
One first defines for any complex $z$:
$$e^z=\sum_{n=0}^{+\infty} \frac{z^n}{n!}$$
which is an absolutely convergent series. It is its own derivative. And then you get some other results, like
$e^z$ is never equal to zero. But the two most striking ones are:
There exists a positive number $\pi$ such that $e^{\pi j/2} = j$ and such that $e^z = 1$ if and only if $z/(2\pi j )$ is an integer.
<p><span class="math-container">$e^z$</span> is <span class="math-container">$2\pi j$</span> periodic.</p>
From this, you define the sine and the cosine as the imaginary and real parts. The proof is quite interesting. It for instance remarks that $\cos 2 <0$, and since $\cos 0 =1$, by continuity, there should exists a constant at which the cosine vanishes:

This should answer to Why does $\pi$ exist, with its role unveiled, and why the cosine is periodic.
The answer to the "next integer" is given by Matt's comment.