Best play is folding preflop. You're not deep enogh to make flatting profitable.
Then you're also going to play OOP. Flatting preflop with hands such as Axs could be profitable if and only if you can sometimes bluff your opponent, and you can do this only when playing in position (you can't play hit/fold since you're not going to hit the board enough times to make the play +EV, and once you hit the board you're not going to win a big enough pot since you're playing OOP). I would neither flat small pairs OOP since is simply -EV.
If you have a good read on your opponent you can maybe think to 3bet him light to obtain a fold, but if you thinks he is tilted and he will overplay many hands, just fold.
As played: why do you c/c on the flop? Your hand has no equity at all just a nut redraw which is pretty weak, so I would simply c/f or c/r since he is cbetting probably a lot on a paired board, but he would rarely believe you.
On the river is not that probable that he has got a set since he checked behind on the turn, the only set he could play this way is JJ imho. Pretty close decision if just call or raise. The fact is that if he hasn't a set, then he is bluffing, and raising you just make him fold.