Unless there's a Republic law against Sithery, the Jedi had no grounds to arrest Palpatine - Mace certainly had no grounds to threaten to assassinate him. As a sworn Jedi, Anakin was bound by oath to protect the Republic, and Palps was the legitimately elected leader of the Republic. In a sense, Anakin would have been violating his oath if he didn't attack Mace..
(Well ignoring the fact that Anakin knew he was the Chosen One that was meant to destroy the Sith...and Palpatine was bent on changing the Republic and doing away with it's practices...)
They had a witness who happened to be Palpatine's most trusted and close friend. Not to mention the Republic outlawed the practice of being a Sith after the Ruusaan Reformations, 1,000 years before the movie and the last time the Sith had openly declared themselves.
As a Jedi, Anakin is sworn to uphold the ideals of the Republic, and the Will of the Force. Jedi do not serve one man, or solely the elected leader of the Republic, that's asinine. When Palpatine revealed to Anakin that he was the Dark Lord responsible for the war, the one controlling the C.I.S. (hightreason anyone?), the Jedi had all the justification they needed. Of course, they played right into Palpatine's hands (everything in the PT does). But don't forget the Jedi came to arrest Palpatine and put him on trial. Mace didn't decide to end his life until Palpatine resisted arrest, proved Anakin's testimony to be correct, and then went on to attack and murder 3 Jedi High Council members.
But yeah, Anakin totally was serving the Republic...which was soon after transformed into an Empire that embodied the opposite of what the Republic stood for.