I removed my 3 ring crankset from my old mountain bike and it was welded together so I have to replace the whole thing. The bottom bracket is square taper. The chainrings were 48, 38, and 28 teeth and there's an 82mm BCD. Will this crankset be ok? It seems like it might work because it's square taper (the only thing I took into account.)
The BCD is irrelevant cos you're changing the whole thing. BCD only matters when you're fitting replacement chainrings in the future.
The only measurements that matter are BB interface (square taper, OK), crank length (165mm - is this suitable), and chainline (which is set more by the BB axle than the crankset)
Since you're replacing a triple with another triple, should fit fine.
However the new one is 42/32/22T and the old one is 48/38/28T so you'll probably have to remove 6 links from your chain (6 half links, or 3 wide and 3 narrow links, or 3 complete links, depending on how you want to count them.)
Also your front derailleur mech will probably need to slide down a bit, which means adjusting your front derailleur cable. May as well fit a new one while you're doing this - inners are cheap.
DO NOTE that this will make your gearing lower by ~10% so the top-speedy hard gears won't be there, and you'll have a bit more at the low end for going up steep hills slowly. Do you run out of gears at either end currently?