Suppose I have function
$$y(x)=\begin{cases} x+1\qquad & 0\leq x\leq1 \\ 2-x\qquad & 1<x \leq2 \\ 0\qquad & \mathrm{elsewhere} \end{cases}$$ I need to find the function $g(x)=y(x+2)+2y(x+1)$
$$y(x+2)=\begin{cases} x+3\qquad &-2\leq x\leq-1 \\ -x\qquad & -1<x \leq0 \\ 0\qquad &\mathrm{elsewhere} \end{cases}$$
$$2y(x+1)=\begin{cases} 2x+4\qquad & -1\leq x\leq0\\ 2-2x\qquad & 0<x \leq1 \\ 0\qquad &\mathrm{elsewhere} \end{cases}$$
Now, $$g(x)=y(x+2)+2y(x+1)=\begin{cases} x+3\qquad & -2\leq x\leq -1 \\ x+4\qquad & -1<x \leq0 \\ 2-2x\qquad &0<x\leq1\\ 0\qquad &\mathrm{elsewhere} \end{cases}$$
Now the result looks Okay,
But the problem is the value of $y(x+2)$ at $x=-1$ is $2$ and $2y(x+2)$ at $x=-1$ is also $2$ so if I add both then $y(x+2)+2y(x+1)$ at $x=-1$ will be $2+2=4$,but the value of $g(x)$ at $x=-1$ is $-1+3=2$
\begin{eqnarray} g_1(x)=y(x+2)=\begin{cases} x+3&\text{ for }-2\le x\le -1\\ -x&\text{ for }-1< x\le0\\ 0&\text{ otherwise} \end{cases} \end{eqnarray}
and
\begin{eqnarray} g_2(x)=2y(x+1)=\begin{cases} 2x+4&\text{ for }-1\le x\le0\\ 2-2x&\text{ for }0< x\le1\\ 0&\text{ otherwise} \end{cases} \end{eqnarray}
Giving the result
\begin{eqnarray} g(x)=\begin{cases} x+3&\text{ for }-2\le x<-1\\ 3x+7&\text{ for }x=-1\\ x+4&\text{ for }-1< x\le0\\ 2-2x&\text{ for }0< x\le1\\ 0&\text{ otherwise } \end{cases} \end{eqnarray}
Now we see that $g_1(-1)=2,\,g_2(-1)=2$ and $g(-1)=4$.