DNA polymerases cannot initiate DNA synthesis - they can only add on to an existing strand of DNA or RNA. Role of RNA Primer: DNA polymerases need a double-stranded DNA region to which they can attach in order to begin copying the rest of the DNA strand. In order to provide this double-stranded attachment site, RNA primers are added by primase, an RNA polymerase which does not require such an attachment site itself.
When DNA replication starts, one primer is needed at the start of the leading strand. The lagging strand will need new primers regularly, and they mark the start of the stretches known as Okazaki fragments.
Why DNA Replication uses RNA instead of DNA?
Adding primers is an error-prone process, and DNA replication must copy the original strand with as high fidelity as possible. Using RNA for primers and then copying the original using DNA means that there is "memory" of which bits of the new strand were originally primers and hence more likely to contain errors (any RNA in the copy must have been primers). This allows removing them, in order to then replace them with proper high-fidelity DNA copies. When this happens, there is double-stranded DNA around the sites where primers were located, allowing DNA polymerases to attach there and fill in the gaps.
I think it is need for initiation of the DNA synthesis or support the replication like as when we made a building for the roof we need some supporters, over there we used brick, sand, cement etc. When the roof can stand itself with some pillar, then we remove the supporter. Same as after completing DNA synthesis RNA remove from there.