Install a 4x4 between two walls to hang heavy bag
100 lbs. jostling about creates quite a bit of force. I'd consider a 4x4 adequate up to about 8 feet of span. After that it's going to quickly become a rubber bad. Or worse, it could fracture and come down (hard).
For spans of 8-12 feet, I'd put a 2x10 oriented vertically in a pair of joist hangers, and I'd put another flat on top of it, screwed every foot or so. This creates a rigid T configuration that should be stiff enough. On the wall, span a section of 2x10 across several studs to create a robust surface on which to mount each joist hanger.
For spans longer than that you'd need something even heavier, such as four 2x10s in a double I beam configuration ( like II, which would maybe be good up to 16 feet). Instead, consider spanning a shorter distance between two adjacent walls using 45 degree joist hangers.