$f(x+p)=f(x)$
$\sin^2(x+p)=\sin^2(x)$
$\sin^2(x+p)-\sin^2(x)=0$
$[\sin(x+p)-\sin(x)][\sin(x+p)+\sin(x)]=0$
$\sin(x+p)-\sin(x)=0$
$\sin(x+p)=\sin(x)$
This is the part iI don't get:
$x+p=x+2kπ$
$p=2kπ$
My question: how did we get $x+p=x+2kπ$ from $\sin(x+p)=\sin(x)$
And yeah I know the exercise doesn't end there, but I only want to understand this part first.
To answer the question directly, suppose $\sin^2x $ is periodic with period $p$. We need to find the smallest $p > 0$ such that \begin{equation} \sin^2(x+p) = \sin^2 x \tag{1}\label{eq1} \end{equation} for all $x$, if such exists.
Method 1: $\cos 2x = \cos^2 x - \sin^2 x = 1 - 2\sin^2 x$. Therefore, $\sin^2x = \frac{1}{2}\Big( 1 - \cos2x \Big)$. If you accept that $\sin$ and $\cos$ are both periodic with period $2\pi$ it is thus apparent that $\sin^2x$ is also periodic with period $\pi$.
Method 2: Suppose $\sin^2x$ is periodic with period $p$. Then taking $x=0$ in equation \eqref{eq1} gives $\sin^2 p = 0$. Now we are only interested in the smallest positive $p$ and therefore we must have $p \geqslant \pi$ since $\pi$ is the smallest positive zero of $\sin x$. Now take $p = \pi$.
\begin{align} \sin^2(x+\pi) -\sin^2 x &= \Big(\sin(x+\pi)-\sin(x)\Big)\Big(\sin(x+\pi) +\sin (x)\Big) \\ &= \Big(\sin x \cos \pi + \cos x \sin \pi - \sin x\Big)\Big(\sin x \cos \pi + \cos x \sin \pi + \sin x\Big) \\ &=\Big(-\sin x - \sin x\Big)\Big(-\sin x + \sin x\Big) \\ &=0 \end{align} So we have $\sin^2(x+\pi) = \sin^2(x) $ for all $x$ and $\pi$ is the smallest number with this property so $\sin^2 x$ is periodic with period is $\pi$.