If $g(y)=y^2+2y+1$, then $g(y-1)= \dots$
$g(y-1)=(y-1)^2+2(y-1)+1$.
This is where I get stuck.
If $g(y)=y^2+2y+1$, then $g(y-1)= \dots$
$g(y-1)=(y-1)^2+2(y-1)+1$.
This is where I get stuck.
You have at least two options:
Either you could expand things out after your first step...
g(y-1) = (y-1)^2 + 2(y-1) + 1
= (y^2 - 2y + 1) + (2y - 2) + 1
= y^2 -2y + 2y +1 -2 +1
= y^2
Alternately you could note that g(y) can be factorised...
g(y) = y^2 + 2y + 1
= (y+1)(y+1)
so
g(y-1) = ((y-1) + 1)((y-1) + 1)
= (y)(y) = y^2
Starting from where you're at: \begin{align} g(y-1)&=(y-1)^2+2(y-1)+1 \\ &= \underbrace{\left(y^2 - 2y + 1\right)}_{(y-1)^2} + \underbrace{2y -2}_{2(y-1)} + 1\\ &= y^2 -2y +2y +1 +1 -2\\ &= y^2 \end{align}
EDIT: Whenever we write $a^2$, that means $a\cdot a$. So, in this particular instance, we can think of $y-1$ as our "$a$."
\begin{align} (y-1)^2 &= (y-1)(y-1) \\ &= y(y-1) -1(y-1) \quad \text{(distribute first factor)}\\ &= (y\cdot y - y\cdot 1) + (-y+1) \quad \text{(distribute again)}\\ &= y^2 -y-y + 1\\ &= y^2 -2y + 1 \end{align}