I have a Bike with gears. The rear wheel started wobbling a few weeks back. At first my chain kept getting off every now and then and I couldn't figure out how to fix it permanently. So I stopped changing gears and the problem persisted. After careful inspection I figured it's wobbling side to side that is perpendicular to the wheel central axis. Anyway I opened the screws and the problem is somewhat complicated. There's a component that came out once I opened the rear wheel as you can see in the first image. Can you tell me what's wrong and how to fix it. The wheel wobbles around the central axis. The second image is of a component that came from the inside of the rear wheel gap between the gear and the central screw.
That looks like the mangled remains of a ball bearing cage.
Having been munched and ejected means there's possibly damage to the bearing balls, or that the cone has backed out enough to let this cage fit through.
I would remove the freewheel (tool needed) and then use some spanners and cone-wrenches to reset the preload on the bearings. They should spin freely but with no wobble.
If you wanted to go deeper, pull the cone and locknut off one side, and capture all 9 ball bearings on both sides. Wash them with solvent, and clean the cups and cones. Inspect closely for damage, and if it looks okay then reassemble and regrease. Then preload with correct spanners and see how it goes.
I don't think your axle is broken - test that by holding each end and rotate. They should not spin separately. Also, one side should not "oscilate" while spinning the other side with your fingers - if that's the case then the axle is bent and needs replacing.