Why did Shakespeare name two characters Jacques in As You Like It?
One role of the melancholic Jaques is to symbolically embody the oppressive, depressing realities of town/court life in the thematic debate within As You Like It that pits town against country. Jaques is bitter, cynical, unromantic--he is one of the few central characters who doesn't wind up in a marriage--and given to depressive melancholy.
On the other hand, the other Jaques is Orlando's and Oliver's younger brother. Not only does he serve to show just how loathsomely Oliver has treated Orlando--by detailing all Jaques advantages and opportunities--Jaques also serves as a contrast to Oliver and Duke Frederick, thereby showing the true character and nature of a man from town. Even more importantly, he is the opposite of melancholic Jaques.
That both are named Jaques is a device for drawing audience attention to their contrasting qualities so that when the differences debated throughout about town versus country are brought into balance in Scenes III and IV of Act V, the audience/reader has a firm foundation from which to draw the correct conclusions, those being that town and country are each good in their own ways and it is the quality of a person's inner nature that makes either location good or bad.