Given a series of past coin tosses from an unfair coin, how can I calculate the confidence for the next toss result? So this is really difficult for me, but I would like to know if this is possible.
Let's assume I have an unfair coin (absolutely no assumptions can be made about the coin), and my past result has been T-T-T-H-T-H-T-T-T and I want to predict the the result of the next toss. In a way that let me formulate my answer in this way: "There is an X% confidence that the result of the next toss will be T". So I am trying to solve for X.
 A: 
I would like to know if this is possible. Let's assume I have an unfair coin (absolutely no assumptions can be made about the coin)

If you really can't make any assumptions about the coin, it's not possible. One key assumption is that each throw has a constant probability of tails. Perhaps your coin is unfair because it's made of a metal that deforms, and as you throw it it deforms in such a way that tails becomes more likely?

I want to predict the result of the next toss.

Making the assumption that throws have the same probability of tails (and that each throw is independent), you can then construct a model for the random variable $C$ of the coin landing on tails, where $C$ follows the Bernouilli distribution (each throw is a Bernouilli trial).
The model allows you ro estimate $P(C=\mathrm{tails})$. Of course you've seen 7 tails out of 9 and your estimate based on this sample is $P(C=\mathrm{tails})=7/9$. The model is helpful, because you only have 9 coin tosses, T-T-T-H-T-H-T-T-T, which isn't enough tosses to be sure that $7/9$ is a good estimate, and the model can help you quantify how sure you are about your estimate.

There is an X% confidence that the result of the next toss will be T

Here it's important to distinguish what is meant by probability and confidence. What you'd like to say is that there's an 7/9 probability the result will be T. But you could only do this if you have a very large number of tosses, much larger than 9. The probability 7/9 is known as a point estimate of the probability because it's the "best" single number you can give for the probability. It's helpful to give a range, which is where the confidence interval comes in.
Your model can give you a confidence interval around your point estimate. In this case a 95% confidence interval is from 0.40 to 0.97, which can be interpreted as meaning that it's plausible that the probability of seeing a tails on the next throw is anywhere from 0.40 to 0.97. (Strictly speaking it means that if you repeated your experiment of 9 coin tosses, then the confidence interval you got would contain the actual, true probability of rolling a tail 95% of the time. Look at the confidence-interval tag on this site for more information.)
A: Think of a fair coin for the time being:
We can be reasonably sure that it is fair because we have tossed it, say, 100 times, and it has landed exactly 50 times on heads and 50 times on tails.
In reality, even using a fair coin would probably not get exactly half the throws resulting in heads and the other half in tails, due to the way you throw it, minor imperfections in the coin, and other factors. Also, due to the unpredictable nature of probability, even with a series of perfectly fair tosses it would actually be just as probable for all your throws to land on heads as a half heads/half tails distribution, or indeed any other combination of results. The chance of having a misleading result such as and "all heads" distribution is, however, very small if you toss the coin 100 times, and gets smaller and smaller as you do more tosses, thus showing the importance of gathering lots of data.
But putting aside these things that force our prediction to never be completely perfect, let's go back to the original point: we know beyond reasonable doubt a coin is fair because it lands half of the time on head, and the rest of the time on tails, no matter how may throws you do.
Now let's think of a different coin. We throw it 100 times, but it lands only 25 times on heads and 75 times on tails. Now, the coin could in fact still be a fair coin, and this strange result pattern just be a fluke, but that is very unlikely, so we'll have to suppose that the coin will always throw in this pattern, even if we increase the total number of throws to 100, or 10000, or a million, or even more. After we make this decision to stop throwing for the sake of accuracy and being sure, the maths is simple. As we did 100 throws, and the coin landed on heads 25 times, the coin landed on heads 25/100 times. So the probability of flipping this coin and it landing on heads is 25/100, and if we convert this to a percentage, it is 25%.
If you just want to get a mathematical formula and skip my explanations, the formula for the number of times the coin lands on heads is:
P = H/N
where P is the probability of the coin landing on heads, H is the number of times the coin landed on heads while you were throwing it, and N is the total number of throws you did. 
This will give you a decimal (here 0.25), so to convert it to a percentage (here 25%), you multiply it by 100.
I hope this answers your question and was not too long.
