Should you buy your ex-boyfriend a birthday present if you are friends and may get back together?

A card would be appropriate. A present would entail too much investment for you and perhaps too much obligation from him. Keep it simple, if you wish to acknowledge his birthday.