This is because the - acts like a binary operator within your context (\text{for } on the left and 1 on the right). You can either place everything in the conditional clause of cases inside \text and escape math as necessary, or make the operator unary (with braces; actually making it ordinary):

\documentclass{article}
\usepackage{amsmath}
\begin{document}
\[
g(y) = \begin{cases}
y + 1, & \text{for $-1 \leq y \leq 0$} \\
1 - y, & \text{for $0 \leq y \leq 1$} \\
0, & \text{otherwise}
\end{cases}
\]
\[
g(y) = \begin{cases}
y + 1, & \text{for } {-}1 \leq y \leq 0 \\
1 - y, & \text{for } 0 \leq y \leq 1 \\
0, & \text{otherwise}
\end{cases}
\]
\end{document}
Using {-1} would also work, forcing - to be an ordinary symbol, similar to {-}1.
{-1}(but note$$is not latex syntax) – David Carlisle Dec 05 '19 at 23:41\[…\]preferable to$$…$$? – Werner Dec 05 '19 at 23:47