You flip a coin twice and get two heads. What's the probability that the coin is fair? I don't know how to approach this other than using Bayes' rule. Let $A$ be the event that the coin is fair and let $B$ be the event of getting two heads. We get
$$P(A \mid B) = \frac{P(A\cap B)}{P(B)} = \frac{1/4}{P(B)}.$$
I don't know how to get $P(B)$. Any suggestions? 
Also, how would I generalize this -- say, if we get $n$ heads rather than $2$ heads?
 A: In any realistic model, the distribution of the probability of heads for a physical coin (given a particular flipping method) should be continuous. Therefore the probability that the coin is exactly fair should be 0. 
A: If you impose a prior distribution on the bias $p$ of the coin (i.e. $p$ is the probability of getting a head), you can compute the posterior distribution given 2 heads. For example, you can impose $p \sim U[0,1]$ in the absence of any other information.
Then you can write:
$$f(p|2H) = {P(2H|p)f(p) \over P(2H)}$$
$$= {p^2 f(p) \over \int P(2H|p)f(p)dp}$$
If you assume a uniform prior, i.e. $f(p)=1, \; p \in [0,1]$, you get:
$$f(p|2H) = {p^2 \over \int_0^1 p^2 dp} = 3p^2$$.
Under the uniform prior assumption, the result easily generalizes to: $f(p|nH) = (n+1)p^n$, the mean of which is ${n+1 \over n+2}$. The mean and the overall distribution keep skewing closer toward 1 as you see more heads in a row.
Whether the uniform prior is a good assumption or not is a separate issue (I don't there is enough information available to answer that).
