Rex is the captain of the 501st Legion's Torrent Company and the clone trooper through whom The Clone Wars tells its side of the war. He debuts in the 2008 theatrical film that launched the series and is voiced, like every clone in the franchise, by Dee Bradley Baker.
The argument the character makes
Rex exists to answer a question the prequel films never asked: what is it like to be one of these men. The Republic's army is a purchased, grown, disposable population with no civil rights and no post-war plan, and The Clone Wars spends six seasons refusing to let that be background. Rex is the audience's fixed point in it — competent, dry, loyal to the men beside him well before he is loyal to the institution above him.
Rex and Ahsoka
His relationship with Ahsoka Tano is the series' central friendship. It starts with a captain being handed a fourteen-year-old commander and ends, in the Siege of Mandalore, with the two of them alone on a crashing Star Destroyer burying the men Order 66 turned against them.
Order 66
The final arc of The Clone Wars is built around Rex's inhibitor chip. He has known since the Fives affair that something is wrong with the clones' implants; he has been ignored; and when the order comes he fights it consciously, long enough for Ahsoka to cut the chip out. The scene is the payoff of a plot thread the show laid down five seasons earlier, and it is the closest the franchise has come to putting Order 66 in the first person.
Afterwards
Rex appears in The Bad Batch running a network that removes chips from other clones, and in Star Wars Rebels as an old man on Seelos and then a Rebel Alliance officer, fighting at Endor. He is one of the very small number of clones the story allows to grow old and choose a side.
Rapid ageing
The clones are engineered to mature at roughly twice the normal rate, which is why a man born after The Phantom Menace is visibly elderly by Return of the Jedi. It is a piece of production convenience that the later series turned into the army's quiet tragedy: they were built to be finished quickly.
Continuity
Canon. Rex was created for The Clone Wars in 2008, before the reset, and survived it intact — one of the few animated-era characters whose biography was carried across without amendment.