Periodicity of the output of causal time-invariant systems when the input is periodic
Your line of reasoning is correct. For a (not necessarily linear) time-invariant system the following always holds: if $y(t)$ is the response to an input signal $x(t)$, then $y(t+T)$ must be the response to the shifted input signal $x(t+T)$. If the input is periodic with period $T$, this implies that $x(t)=x(t+T)$, and, consequently, $y(t)=y(t+T)$, i.e. the output signal is periodic with the same period as the input signal.

Furthermore, if the system is causal and the input up to time $t_0$ is periodic, the output up to time $t_0$ must be periodic too, because a causal system cannot know the (possibly non-periodic) input beyond time $t_0$.

This is (part of the) theory. But then comes @MBaz with his "counter-example" of an ideal integrator. The problem here is indeed, as already noted in a comment, the integrator's instability. Showing the time-invariance of a linear system involves manipulating the convolution integral. However, if for the given input signal that integral is divergent, the proof becomes invalid. And this is the case with systems having poles on the $j\omega$-axis (or, for discrete-time systems, on the unit circle). If an LTI system has a pole on the $j\omega$-axis and if you excite it with the corresponding pole frequency, you get an output signal with increasing amplitude, which is obviously non-periodic. You can also see it in the following way: the response of an LTI system to a complex exponential $e^{j\omega_0 t}$ is

$$y(t)=H(\omega_0)e^{j\omega_0 t}\tag{1}$$

Eq. (1) of course requires that $H(\omega_0)$ can be evaluated. For an ideal integrator this is not the case for $\omega_0=0$. Note that if the input signal to the integrator had no DC component, then the response to a periodic input signal would indeed be periodic.