Agree w/ Cabert - in the middle ages, trade monopolied techs to all others (in the same turn). Note that the value of the tech in question drops as more people get it, so the order in which you trade is important - First trade with those who will give you techs and gold, then with those who will only bankroll you. Some techs you may not want the opposition to have (civil service, etc.), but note that the AI will trade it when they acquire it, so wait until one other has it and get everything you can from the others. Otherwise, they'll reap the rewards. Around the middle ages, you should have a shrine or two, which helps keep the research slider up. Cottaging heavy in two or three cities, along with tech trading, can usually solidify a tech lead at Monach. Also note the importance of Printing Press and Education and the impact they have on technology. Further on this point, Printing Press is cheaper and is IMMEDIATELY applied to all cottages whereas Education takes time to build universities, so go PP first (uni's will then multiply the cottages w/ PP advantage). Immediately then go for Liberalism, a free tech and some civic options.
By doing so, I usually boost way ahead of others in tech during the middle ages, not fall behind. Enough so, in fact, that tech trading after Liberalism is usually halted as it helps the adversaries more than it does me.