Arduino mega 2560 crystal oscillator

I was trying to study the relation between the applied voltage and crystal skew.

What voltage?

But it seems the board has resonator which is not very accurate.

A brain-dead decision.

How can I solve this problem.

You can replace it with a crystal oscillator or an external clock.

My aim was to obtain less than 5ppm error with the arduino

Very easy to do.

without using any external clock.

That can be challenging. Crystals guarantted to be in that range are expensive and not very common. A far simpler / cheaper solution is to use external clocks. TCXOs for example are that much more expensive than a crystal.