The pun that you are asking about plays on the two meanings that “rank” can have. “Rank” can, of course, refer to a person’s status or position. We can say someone holds an important rank in society, for example. But “rank” can also mean “strong smelling.” We can talk about a “rank odor,” for example. This is the pun Rosalind is making; she is suggesting that Touchstone stinks.
In this scene, Touchstone says something to Le Beau and Celia tells him he had laid it on too thick. Touchstone says that he has to do stuff like that because otherwise, he will lose his rank. He means he will lose his reputation as someone who makes a lot of dumb jokes. He says “…if I keep not my rank” and Rosalind then says “Thou losest thy old smell.” She is saying that he stinks, playing on the idea that “rank” means “stinky” rather than “status.”