<s>[INST] What is the probability f(p) of A winning the match? 
Here's my approach:
Let A denote the event "A wins the game" and B denote the event "B wins the game"
I am supposed to calculate the probability f(p)
There are two possible cases:-
i) A wins within 4 games
Possible cases: AAA,ABAA,BAAA,AABA
ii) A doesn't win within 4 games
Possible cases: AABB(A and B occur 2 times each) ABABABAB...(A and B occur k times each) AA
AABB can be arranged in 6 ways
ABABAB.... can be arranged in $(2!)^k$ ways (A and B are adjacent to one another)
Now :
f(p) = P(case i) + P(case ii)
P(case ii) = $(6 (p^2) (1-p)^2 ) \sum_{k=1}^∞  2^k . p^k . (1-p)^k. p^2  $=$(6 (p^4) (1-p)^2 ) \sum_{k=1}^∞  2^k . p^k . (1-p)^k$
= $(6. 2 . p^5 . (1-p)^3)/(1-2p+2p^2)$ (The denominator seems correct)
P(case i ) = $p^3 +3p^3(1-p)$
f(p) = $p^3 +3p^3(1-p) + \frac{(6. 2 . p^5 . (1-p)^3)}{(1-2p+2p^2)}$
The expected answer is not produced by solving the above equation.Where did I go wrong?
Edit:-
I finally figured out the mistake that I made in the above solution.
In P(case ii) = $(6 (p^4) (1-p)^2 ) \sum_{k=1}^∞  2^k . p^k . (1-p)^k $, I replaced $\sum_{k=1}^∞$ with $\sum_{k=0}^∞$ . There has to be one case when B does not occur after the tie, i.e. A occurs only two times.
P(case ii) =  $(6 (p^4) (1-p)^2 ) \sum_{k=0}^∞  2^k . p^k . (1-p)^k $
=  $(6 (p^4) (1-p)^2 ) .[1+2p(1-p)^1+2^2.p^2.(1-p)^2+...]$
=$(6 (p^4) (1-p)^2 ) .\frac{1}{1-2p(1-p)}$
f(p) = P(case i) + P(case ii)
=$p^3 +3p^3(1-p)+(6 (p^4) (1-p)^2 ) .\frac{1}{1-2p(1-p)}$
=$p^3[1+3(1-p)+\frac{6p(1-p)^2}{1-2p(1-p)}]$
=$p^3[1+(3-3p)+\frac{6p-12p^2+6p^3}{1-2p+2p^2)}]$
=$p^3[\frac{(1-2p+2p^2)+(3-6p+6p^2-3p+6p^2-6p^3)+(6p-12p^2+6p^3)}{1-2p+2p^2)}]$
=$p^3\frac{(4-5p+2p^2)}{1-2p+2p^2}$
 [/INST] I would treat the $2$-$2$ case separately.  Calculate the probability that $B$ has won by the end of Game $4$.  Then you know the probability of arriving at a $2$-$2$ tie.
$A$ wins within $4$ games with probability $p^3+3p^3(1-p)=4p^3-3p^4=p^3(4-3p)$.
$B$ wins within $4$ games with probability $(1-p)^3+3p(1-p)^3=(1-p)^3(1+3p).$
A $2$-$2$ tie occurs with probability $y=1-[p^3(4-3p)+(1-p)^3(1+3p)]$.
In a $2$-$2$ tie, the probability that $A$ wins immediately is $p^2$, the probability that $B$ wins immediately is $(1-p)^2$, and the probability that we reach another tie is $2p-2p^2$.  This, if you reach the tied state, the probability $x$ that $A$ eventually wins the game satisfies $x=p^2+(2p-2p^2)x$, so $x=\dfrac{p^2}{2p^2-2p+1}$.
Thus, the probability that $A$ wins is $p^3(4-3p)+xy$.
I haven't worked through the algebra to confirm this results in the expected answer, nor have I worked through your algebra to see whether the mistake is there or in the way you've set up the problem.
A tweak to this approach is to observe that if the match is tied $1$-$1$, the probability of an $A$ win is $x$, calculated above, because we're already in the position where the first player to lead by $2$ wins.
$A$ will lead $2$-$0$ with probability $p^2$ and once there, will win without going to "overtime" with probability $p(2-p)$.
$B$ will lead $2$-$0$ with probability $(1-p)^2$ and once there will win without going to "overtime" with probability $1-p^2$.
</s>