Does gravitational force do work onto an object being lifted?

If I am lifting an object upwards, is gravitational doing work onto the object? I am uncertain whether for this case, is it the force I exerted doing work onto the object or is it the gravitational force or both?

Yes the gravity does negative work to the object because the object's position in the direction of application of gravity changes.

Both you and gravity are doing work.

You are doing positive work when you lift the object because the direction of the force you apply to the object is in the same direction as the displacement of the object. Positive work transfers energy to the object.

At the same time, gravity is doing negative work because its force is in the opposite direction to the displacement of the object. Negative work takes energy away from the object. In this case, gravity takes the energy you supply the object and stores it as gravitational potential energy of the earth-object system.

The difference in magnitude between the work you do and the work gravity does equals the change in kinetic energy of the object per the work energy theorem. If the object begins and ends at rest, the net work done is zero because there is no change in kinetic energy. All the energy you transferred to the object is converted by gravity to gravitational potential energy of the earth-object system.

Hope this helps.

I think that when you say, "an object being lifted," that's a distraction from the purest physical description of the action. When you stand on the Earth and you "lift" a pencil, you aren't just applying force to the pencil. You are applying an equal an opposite force to the Earth. (Ignoring your own weight, because it will only cancel out of any equations that truly describe the situation.)

Instead of saying, "I 'lift' the pencil," you could say, "I separate these two gravitating bodies --Earth and pencil--from each other." From that point of view, you aren't doing work on the pencil, you are doing work on the Earth-pencil system--you are raising that system to a higher energy state. And then, I think, you don't need to speak of gravity as doing any work at all. Rather, it's just the field against which you are working.

Conversely, if you then gently lower the pencil, it's the Earth-pencil system doing work on you as it returns to the lower energy state.

Work is done whenever a force acts parallel to a displacement. So, when you lift the object, both your lifting force and gravity do work.