so the thing is that i have to prove that if the language $L ⊆ \Sigma^*$ is decidable then both languages are also decidable. $$P_1(L) = \{w ∈ Σ\mid \text{ For every prefix v of w, we have }v ∈ L\},$$ $$P_2(L) = \{w ∈ Σ\mid \text{ There's a prefix v of w, so that }v ∈ L\}.$$
My idea is to create two TM for $P_1$ and $P_2$ and prove that they're decidable, but I don't know if it's right or not, and even if it is I have no clue how to proceed. I would be thankful for every help or tip!