When do city-states discover technology and resources?
I am waiting for someone else to provide a better more accurate answer.
My observations are that City States can discover a resource before you do. An example of this is a city state I am allied with, will provide me with coal. However, I have not discovered coal and it does not even appear as a counter at the top of the screen yet. This proves that a city states technology is not in line with your own. A guess is they they would have access to all technologies cumulative of all player discoveries. This is because I find my greatest AI threat will upgrade to Infantry and then suddenly the city states around me upgrade to infantry.
Wildly guessing now! Another theory is that any CS that ally with a player gets their technology. If this is true, then it could mean that CS that are neglected as allies could have poor defence force technology. I will keep an eye on this on future games.
Secondly, if the city state does not have a worker they will be very slow to improve the tile. This is usually after they have survived a barb attack or foreign attack but have lost their only worker in the process.
I am unsure with the timeline of patches if city states do end up replacing workers because previously this was a problem. Not helped by a block that prevents gifting of workers. So no, you cannot help a CS with their tile improvements by using your own workers or by gifting workers.
As for the oil rig. It could be that they have discovered oil, but not oil rig tech. I am unsure about the build rate of worker boats. I do notice that the CS often works the sea resources quickly. But it could be a worker boat bug. i find that my automated worker boats will often move to a sea resource and then just sit on top of it. annoying. If the city state does the same, it could be connected to the same issue.
City-states have access to any techs researched by at least one major civilization. Unfortunately you can't help or force a CS to develop its resources. In this case you can wait, trade with a major civilization, conquer the CS, or build a different selection of units.