Can an individual gear/cog on the rear cassette be replaced? I'm trying to figure out how the rear cassette is put together, and I found this related question that suggests at least maybe the lowest gears can be replaced. I'm trying to figure out if in general any and all of the cogs in a rear cassette can be swapped out with new replacements should any get damaged or worn? I imagine some may be designed to be an all or none deal, but if one's rear cassette supports replaceable cogs what would be the giveaway to do a visual inspection for?

This question is also distinct from Is it practical to replace two sprockets on a cassette? where the focus is on practicality of replacement but not so much of how to discover if replacement is applicable to a given cassette. It's also distinct by relating to the whole cassette in general with respect to all of its cogs.
According to the late great Sheldon Brown, yes you can change an individual sprocket in a cassette, at least for Shimano.  Some cassettes have small bolts or rivets holding the gears together, but this is for convenience.

Most Shimano cassettes made in the '90s or later have a feature called Hyperglide (probably a registered trademark) that enables smoother shifts, by allowing the chain to engage two adjacent sprockets simultaneously.  Hyperglide works by giving each individual tooth a more complicated shape to facilitate shifts to and from each sprocket.  In order for Hyperglide to work, the adjacent gears have to be carefully matched to each other.  So if you change a sprocket for another sprocket with a different number of teeth, then shifts to and from that sprocket won't be as smooth.  But as Sheldon pointed out, that's what everyone was used to for decades before the invention of Hyperglide, so that needn't bother you.

I haven't been able to find anything on Sheldon's site about changing sprockets for Campagnolo or SRAM, but I would assume that those brands shape their sprocket teeth similar to the way Shimano do, and so similar concerns must apply for those brands also.

Personally, if a few of the sprockets in my cassette were worn, I would just change the whole cassette (and the chain also of course).  You're unlikely to save any money or hassle by just changing one or two sprockets, because the vast majority of bike riders change the whole cassette.  Most people who want to change just one or two sprockets want a particular combination of gear ratios for specific reasons.