The US doesn't have a prime minister and is doing well without one. But many other presidential republics do have a PM. What's the purpose of prime ministers in presidential republics (note, I'm not asking what they do, what their duties are, etc.)? Why can't a president simultaneously be the head of the cabinet of ministers? It prevents unnecessary and potentially harmful rivalry between the two.
What's the purpose of prime ministers in presidential republics
What you seem to be describing is the "semi-presidential" system rather than the traditional "presidential" system in the United States. It's important to be accurate with terminologies so as not to create confusion.
Here are examples of democratic countries with semi-presidential systems, where the President shares power with the Prime Minister:
The purpose of this arrangement is to introduce a higher degree of accountability to the President, who may be tempted to abuse his or her power. Having a Prime Minister to exercise some powers on the President's behalf introduces an extra layer to separation of power.
The President, who is democratically elected and accountable to the people, is almost always in charge of the army and foreign policy. He or she appoints the Prime Minister who, depending on the country, may need to be approved by the Parliament first.
The Prime Minister - who depending on the country can be fired by the President or Parliament or both - is usually in charge of running domestic affairs. Under this system, the Prime Minister must constantly balance the interest of the President and the Parliament, which leads to a level of moderation and accountability you don't often see in pure presidential systems such as the United States.
With this arrangement, you get a democratically elected President who can act swiftly and effectively when it comes to external affairs, and a Prime Minister who is very much mindful of the Parliament's interest at all times.
This is a compromise system designed to reduce conflict between the executive and legislative branch.
Why can't a president simultaneously be the head of the cabinet of ministers? It prevents unnecessary and potentially harmful rivalry between the two.
Contrary to your assumption, the President and the Prime Minister don't usually form rivalry under semi-presidential systems.
There are several reasons for this:
The President appoints the Prime Minister, so whoever becomes Prime Minister in the first place must be at least sympathetic with the President's values already.
The President can usually fire the Prime Minister any time, so there is no dispute over who runs the show in the room.
The President and the Prime Minister don't usually have overlapping jurisdictions. They do not interfere with each other's jobs so there are less chances of friction.
It varies greatly from country to country.
In some countries, the President is not politically active and is mostly a ceremonial figure. They formally convene and prorogue Parliament and can have a role in recognising a coalition as commanding the support of Parliament but they don't make policy. This is the case in Ireland and Germany (for example)
In other countries the difference is the separation of powers between the legislative and executive branches of Government. fIn this model the President enforces the laws that already exist using money that they can raise by taxes. The Prime Minister has a role in Parliament in leading the creation of new laws and approving (or not) the President's requests for money. France is an example of such a system
The US has a role that, while not named "Prime Minister" is very similar to some named Prime Minsters: the Speaker of the House is a de facto "Prime Minister"
In others the President has wide and general powers to rule by decree and the Prime Minister (and by extension parliament) is a consultative body that offers advice and approval of the Presidents actions, giving at least the appearance of a democratic system.
A President could be head of the cabinet of Ministers. However if the Ministers are chosen from the majority in Parliament and the President is chosen separately then it is possible that the Ministers are all from a different Party to the President. So having a President chair the Cabinet doesn't avoid conflict.
Finally it would be possible to have a system, in which there is only the Prime Minister. This is the de facto situation in Sweden, in which the Monarch has only ceremonial powers and no role in governance at all.
The term "President" is generally reserved for someone who is elected independently, as opposed to someone who is accountable to the legislature and serves at its pleasure.
In many parliamentary republics, the President serves the roles of the monarch in a Westminster style constitutional monarchy.
Most importantly, the President shepherds the process of organizing a new parliamentary majority under a new prime minister following an election in cases where there is not a single party with an unambiguous majority, serves as symbolic head of state, and serves as a central clearing house at which an authoritative set of adopted legislation is presented.
In those parliamentary republics, the prime minister is head of government with full executive branch authority and plays a leading role in determining which legislation will be adopted by parliament, but does not subject to removal in a vote of "no confidence" at any time, if the prime minister either loses the backing of a majority party or coalition, or never had one in the case of a "minority government".
In theory, it would be possible to have a system like this one with no President at all, or merely a short term figure, like the outgoing Prime Minister, serving in that role. But as it happens, that is the less common choice.
Some parliamentary republics (called semi-Presidential), however, give the President somewhat greater authority, often giving the President power over foreign affairs, defense and certain key appointments (such as appointments to a constitutional court) and leaving domestic policy to the prime minister.
The purpose is:
(1) to divide authority so that no one person has absolute authority over everything,
(2) to vest decisions on certain issues of clear national importance in someone elected on a national basis so that the narrow interests of a few members of parliament in swing seats relevant to the prime minister's ability to stay in power in the moment does not impact existential questions for the state as a whole which are vested in the President,
(3) because the President is typically elected for a fixed term, rather than at the pleasure of parliament, this also gives the President the power to take actions, usually on the international scene, that may be very unpopular in the short term, even though they are in the nation's longer term best interest, and
(4) it spares the President the controversies that inevitably arise in day to day domestic politics while leaving the President with what are often more bipartisan issues against with the nation can unite against a common rest of the world, increasing the legitimacy of Presidential actions.
U.S. Style Strong President Systems
In a U.S. style system where the President is both head of state and head of government (as in many Latin American democracies whose constitutions were modeled on the U.S.), there either is no prime minister, or the prime minister is, in truth, no more than the equivalent of the U.S. Speaker of the House, or Majority Leader or President of the Senate, with no executive branch authority.