You should use Bayes Rule, but if you are new to these types of problems, here is a way to maybe intuitively see what is happening.
You need to go down both branches of what could happen on the first coin toss. When you take that first coin and flip it, there are 4 possible endpoints. Fair coin - heads, fair coin - tails, biased coin - heads, biased coin - tails. Their probabilities each are $\frac{1}{2}\times\frac{1}{2}=\frac{1}{4}$, $\frac{1}{2}\times\frac{1}{2}=\frac{1}{4}$, $\frac{1}{2}\times\frac{4}{5}=\frac{2}{5}$, and $\frac{1}{2}\times\frac{1}{5}=\frac{1}{10}$. The first $\frac{1}{2}$ in each of those probabilities is the probability of choosing that type of coin and is really $\frac{5}{10}$.
So, now that we know that, we can look at the event of getting a head on the first toss. The probability of that head being from the fair coin is $$\frac{0.25}{0.25+0.40}$$and the probability that the head was from the biased coin is $$\frac{0.40}{0.25+0.40}$$
So given that the first coin was a head, there is a $\frac{5}{13}$ chance it was the fair coin and a $\frac{8}{13}$ chance it was the biased coin.
From there you can calculate the probability of getting a fair coin for the second coin. $$\frac{5}{13}*\frac{4}{9}+\frac{8}{13}*\frac{5}{9}$$
Best Answer
Firstly, we define the events:
With those events defined, the event we are looking for is $F | 5H$. We can use the Bayes' rule
$$P(F|5H) = \frac{P(5H|F)\cdot P(F)}{P(5H)}$$
Now we have to find every probability in the RHS:
Simplifying the last two probabilities gives $P(5H|F) = \frac{6}{64}$ and
$P(5H) = \frac{6}{64} \cdot \frac{3}{4} + (5\cdot\frac{8}{10}^5 \cdot\frac{2}{10}) \cdot \frac{1}{4} $
Plug the numbers in the Bayes' rule and you got the answer.