I don't understand the part where it "adds $2k+1$ to both sides" and
ends up with $(k+1)^2$.
Since you are trying to proof the assertion with the help of induction you have to first show that $P(1)$ is true. In the second step (induction step) you have to show that $P(k+1)$ is true, where you assume that $P(k)$ is true. The author realized that the term $1 + 3 + \dotsc + 2k-1$ is obviously part of the term $1 + 3 + \dotsc + 2k-1 +2k +1$. Since the author knows that $1 + 3 + \dotsc + 2k-1=k^2$ (by the assumption "$P(k)$ is true") he just added $2k+1$ on both sides and calculated that the right hand side to get $k^2+2k+1=(k+1)^2$, which shows that $P(k+1)$ is true.
A better way would be the following: Let us assume that $P(k)$ is true for a $k\in \mathbf N$. Let us show that $P(k+1)$ is true aswell. Therefore we have to show that $1 + 3 + \dotsc + 2k-1 +2k +1 =(k+1)^2$. We have by the induction hypothesis
$$1 + 3 + \dotsc + 2k-1 +2k +1= k^2 +2k+1$$
and since the right hand side equals $(k+1)^2$, we are done.