Both. Neither.
In some ways offsets are similar to investments, since the buyer is supporting the construction of a project in order to claim a share of the greenhouse gas reductions it achieves. On the other hand, they’re similar to donations in that the transaction is ethically motivated.
In many ways though, offsets are best thought of as purchases. When you buy an offset you’re purchasing the right to claim an emission reduction and use it to balance out your own emissions. Technically you never own the offsets though—they’re automatically retired on your behalf.