So the question asks:
We want to drive from A to B. See the road map in the figure below. Because of snow, each of the five roads (R1−R5) can be closed with probability $p$, independently of all other roads. What is the probability that we can reach B? (Hint: Condition on R5.)
So so far I have:
Suppose the point between R1 and R2 is C and the point between R3 and R4 is D
P(A to B) = P( open road A to B | R5 closed) U P(open road A to B| R5 open)
= P( open road A to B | R5 closed) * P(open road A to B| R5 open)
P(open road A to B | R5 closed) = [P( open road A to C| R5 closed) ∩ (open road C to B| R5 closed)]
= P(open road A to C | R5 closed) * P(open road C to B| R5 closed)
= { 1 - P ( (first road blocked| R5 closed) ∩ (second road blocked| R5 closed) )
= { 1 - P(first road blocked| R5 closed)P(second road blocked| R5 closed) }2
= $(1-P^2)^2$
P(open road from A to B| R5 open) = [P( open road A to C| R5 open) ∩ (open road C to B| R5 open)]
= P(open road A to C | R5 open)P(open road C to B| R5 open)
= { 1 - P ( (first road blocked| R5 open) ∩ (R2 and R3 blocked| R5 open) )
= ( 1 - P(first road blocked| R5 open)P(R2 and R3 blocked| R5 $open) )^2$
$= (1-P*(0.5P))^2$
$=(1-P^2/2)^2$
= $(2-p^2)^2/4$
P(A to B) = P( open road A to B | R5 closed) * P(open road A to B| R5 open)
$= (1-P^2)^2 (2-p^2)^2/4$
But unfortunately this was marked wrong, so where am I doing wrong? What is the right way to do this kind of problem?

You are getting your and and ors confused.
Moreover, the mixing of math symbols and words doesn't help. It bloats the lines and hides errors in the mess. Keep your math statements neat and tidy.
Since we know the events are independent, we can dispense with conditionals. Further, since we also know that the events are Bernoulli, and the roads are indexed, why not use indexed letters for the probabilities?
Since the roads are indexed and their closure independent, we can denote their probabilities of being opened by $q_1,q_2,q_3,q_4,q_5$. All are equal to $1-p$ but the indexing gives us self-commenting code to make it clear where the logistics lays.
We may pass from $A$ to $B$ :
Which is to say:
$$\begin{align}p_{AB} = & ~ (1-q_5)(q_1q_2+q_3q_4-q_1q_2q_3q_4)+q_5(q_1+q_3-q_1q_3)(q_2+q_4-q_2q_4) \\[1ex] = & ~ p(2(1-p)^2-(1-p)^4) + (1-p)(2(1-p)-(1-p)^2)^2 \end{align}$$
Simplify and complete.