State legislatures have to power to choose the electors who choose the president, no matter who wins the election in that state. See Bush V. Gore. The Supreme Court ruled that state legislatures have plenary (plenary authority refers to the complete power of a governing body) power to choose electors. If Romney wants to flip the EC result, he could use the 36 GOP state legislatures to select a winning slate.
Would the GOP do such an outrageous thing? In 2000, Bush had a secret plan to contest the election if he won the popular vote but lost the EC. Also in 2000, in Florida, the GOP state legislature declared that if Gore won the recount that they would still give the election to Bush. I heard no complaints from anyone about that. If the GOP tried to do it this time, they'd find some way to justify it to their voters, which wouldn't be hard, since they accept subverting democratic ideals below their own agenda. See voter ID laws. The GOP would just say that the founding fathers left the power of state legislatures to choose electors for just such a situation.
From Bush V. Gore:
" The individual citizen has no federal constitutional right to vote for electors for the President of the United States unless and until the state legislature chooses a statewide election as the means to implement its power to appoint members of the Electoral College. U. S. Const., Art. II, §1. This is the source for the statement in McPherson v. Blacker, 146 U. S. 1, 35 (1892), that the State legislature's power to select the manner for appointing electors is plenary; it may, if it so chooses, select the electors itself, which indeed was the manner used by State legislatures in several States for many years after the Framing of our Constitution. Id., at 28-33. History has now favored the voter, and in each of the several States the citizens themselves vote for Presidential electors. When the state legislature vests the right to vote for President in its people, the right to vote as the legislature has prescribed is fundamental; and one source of its fundamental nature lies in the equal weight accorded to each vote and the equal dignity owed to each voter. The State, of course, after granting the franchise in the special context of Article II, can take back the power to appoint electors. See id., at 35 ("here is no doubt of the right of the legislature to resume the power at any time, for it can neither be taken away nor abdicated") (quoting S. Rep. No. 395, 43d Cong., 1st Sess.)."
"So what if Gore wins such crucial battleground states as Florida, Michigan and Pennsylvania and thus captures the magic 270 electoral votes while Bush wins the overall nationwide popular vote?
"The one thing we don't do is roll over," says a Bush aide. "We fight."
How? The core of the emerging Bush strategy assumes a popular uprising, stoked by the Bushies themselves, of course.
In league with the campaign - which is preparing talking points about the Electoral College's essential unfairness - a massive talk-radio operation would be encouraged. "We'd have ads, too," says a Bush aide, "and I think you can count on the media to fuel the thing big-time. Even papers that supported Gore might turn against him because the will of the people will have been thwarted."
Local business leaders will be urged to lobby their customers, the clergy will be asked to speak up for the popular will and Team Bush will enlist as many Democrats as possible to scream as loud as they can. "You think 'Democrats for Democracy' would be a catchy term for them?" asks a Bush adviser.
The universe of people who would be targeted by this insurrection is small - the 538 currently anonymous folks called electors, people chosen by the campaigns and their state party organizations as a reward for their service over the years."