Here is another way to view this.

Let's look at local sections of $\mathbb{P}^1_w$. Cover $\mathbb{P}^1_w$ by affine charts $U_0$ and $U_1$. Then $\mathcal{O}_{\mathbb{P}^1_w}$ and $\mathcal{O}_{\mathbb{P}^1_w}(-1)$ can be viewed as following pictures:

$$
\rlap{\underbrace{\phantom{\cdots w^{-3}, w^{-2}, w^{-1}}}_{U_0}} w^{-3}, w^{-2}, w^{-1},
\overbrace{1, w , w^2, w^3, \cdots}^{U_1}
$$
$$
\underbrace{\cdots w^{-3}, w^{-2}, w^{-1}, 1\,}_{U_0} , \,
\overbrace{ w , w^2, w^3, \cdots}^{U_1}
$$

For example, the local sections of $\mathcal{O}_{\mathbb{P}^1_w}$ over Spec$k[w]$ are $1, w, w^2,\cdots$ and over Spec$k[w^{-1}]$ are $1, w^{-1}, w^{-2},\cdots$. So the global section is only $k$.

Now suppose we have the morphism given by $z=w^3$. Then we can decompose $\mathcal{O}_{\mathbb{P}^1_w}$ as following three:

$$
\rlap{\underbrace{\phantom{\cdots w^{-9}, w^{-6}, w^{-3}}}_{U_0}} w^{-9}, w^{-6}, w^{-3},
\overbrace{1, w^3 , w^6, w^9, \cdots}^{U_1}
$$
$$
\underbrace{\cdots w^{-8}, w^{-5}, w^{-2}}_{U_0}, \,
\overbrace{ w^{1}, w^4 , w^7, \cdots}^{U_1}
$$
$$
\underbrace{\cdots w^{-7}, w^{-4}, w^{-1}}_{U_0}, \,
\overbrace{ w^{2}, w^5 , w^8, \cdots}^{U_1}
$$
Hence
$$f_* \mathcal{O}_{\mathbb{P}^1_w} = \mathcal{O}_{\mathbb{P}^1_z} \oplus \mathcal{O}_{\mathbb{P}^1_z}(-1)^{2}.$$