My comment was wrong, and it explained how Cale found out about Walker, but he was the Head of the Presidential Detail, not the Speaker of the House of Representatives (that one was Raphelson).
Near the end, Walker gets the nuclear launch codes via a pager, and writes them down. Fast forward a few minutes, and Walker is dead, an air strike is averted, and all seems to be well. However, the deputy special agent Finnerty (Maggie Gyllenhaal) calls him on the phone with
Finnerty: Walker had no prior contact with any of the terrorists, but someone else did. This guy, Stenz, made multiple calls to a secure line in D.C., but we don't know who received them. The database was wiped 30 minutes ago.
Cale: Really? Did you check Walker's personal records? His computer, his e-mails?
Finnerty: You don't know Walker, John. He was a dinosaur. The man still used a pager.
At this point, Cale -- who was a Raphelson's (the Speaker's) bodyguard -- connected the dots (his face was just a bit short of a little cartoonish "I have an idea" light bulb above his head :-)).
He knew his boss was using a pager, which is quite rare these days. Since Raphelson had the valid nuclear codes, and was made president in all that mess, and has ordered an air strike on the White House (which would kill all the witnesses and destroy all the evidence), it all made sense, once the idea that it was Raphelson all along was triggered by Finnerty's mention of the pager.
Cale says some of this stuff in his final chat with Raphelson:
Cale: Well, Walker had to get the launch codes from somewhere and you were the only person with those codes. And I found this pager in Walker's pocket. I only know one other person that uses one of these.
Would have been better if the evidence had been destroyed in the air strike that you ordered.