I attached a sphere to a circle curve with the follow path constraint, but when i try to speed up and slow down the object with the "Path Animation > Frame" value with keyframes the object goes backwards at some point.
Instead of using a follow path constraint you can do this:
Add an empty in the world origin. Parent your sphere to it (Keep offset). Then animate the z-Rotation of the empty/sphere, which is much easier to use.
I've taken your blend file and parented the sphere to a rotating empty which is parented to an empty that's moving back and forth on the Y axis. The elliptical curve object is just to visualize the path of the sphere.
Your original sphere had an orbit with a diameter of 33.8 metres, so I set the sphere 16.9 metres away from the empty which makes a full rotation in 201 frames (to make it loop correctly on 200 frames). The second empty moves from Y = 3 m to Y = -3 m on frame 101 and back to Y = 3 m on frame 201.
This results in an elliptical movement which still has a diameter of 33.8 m on the major axis on the X axis, but the minor axis along Y is reduced by 6 m to 27.8, the Y distance that the second empty travels from one side to the other.
Because the rotating empty is 3 m away from the oscillating empty on the Y axis, the center of the elliptical movement is at X = 0 and Y = -3. (By the way, I've set the movement's interpolation to Bézier while the rotation is set to Linear, because otherwise the ellipse is somehow flattened on the short ends.)
This is because on frame 1 the sphere is on its lowest Y position and the osciallting empty is moving in negative Y direction at the beginning 8towards the sphere). If the sphere was on it highest Y position and the oscillating empty starts moving away from it, the ellipse diameter would be stretched in Y direction, exactly + 6 m.
If you start with the sphere in its lowest or highest X location, this will result in a slightly angled ellipse with different diameters (which can surely be calculated by formulas, but I don't have them at hand right now).
Sorry in advance, this will be a bit longer... Here is an explanation for the strange behaviour (which would happen with an open curve as well, the circle is not the reason): I guess after adding the Follow Path Constraint to your sphere, you've hit the Animate Path button under the target. What this does is creating a Generator Modifier on the curve which uses the Frames value under Path Animation to calculate the position where the sphere should be at a certain frame.
For example, the Generator Modifier is by default set to
y = -1 + 1x (where x is current frame and y the Evaluation Time)
To calculate how many percent of the curve the sphere should have been traveled, the Evaluation Time is divided by Frames. With Frames = 100 it takes 100 frames Evaluation Time for reaching 100% of the curve. IF you have an animation of 200 frames and since your curve is a circle, it can travel 200%, so twice the circle.
The -1 at the beginning of the formula ensures two things: at the start on frame 1, your sphere is on position 0% of the circle:
y = -1 + 1*1 = 0
-> 0 / Frames = 0 / 100 = 0 = 0%
At frame 51, your sphere traveled half the circle's circumference:
y = -1 + 1*51 = 50
-> 50 / Frames = 50 / 100 = 0.5 = 50%
If your animation runs for 200 frames, on the last frame you have
y = -1 + 1*200 = 199
-> 199 / Frames = 199 / 100 = 1.99 = 199%
So your sphere has not yet completed 2 full travels around the circle. This will be on frame 201 or in a looping animation back on frame 1, which makes the loop smooth.
Now you have set keyframes for the Frames value, 100 on frame 1, 25 on frame 30 and 100 on frame 60 again. Let's see what that means for the Generator Modifier.
y = -1 + 1*1 = 0 as Evaluation Time with Frames set to 100, 0/100 = 0%.
y = -1 + 1*30 = 29 as Evaluation Time with Frames set to 25, 29/25 = 116%.
So your sphere already traveled 16% more than once around the circle. Then comes Frame 60:
y = -1 + 1*60 = 59 as Evaluation Time with Frames set to 100, 59/100 = 59%.
In this case your sphere jumps back to 59% from 116%. And this problem will always occur when changing Frames, it doesn't matter if the curve is closed or open. Whenever the calculated position gets smaller than the position calculated before, it jumps back. Of course this can be intentionally, for example if you use a sine function to move something back and forth on a curve.