Hi @tartarine,
Good question!
A keyboard is a great choice for training your ears because it’s so easy to play harmonies, and the notes are clearly laid out for you to understand visually.
My recommendation (and the choice I made myself) is to look at digital pianos. They combine the best of both worlds by offering a high quality piano sound and realistic action (meaning the keys have a weight and a physicality to them instead of just being reactionless buttons) in a compact, affordable and always-in-tune package.
The prices tend to be higher than digital keyboards but lower than pianos. So if your budget is tight you might need to go for a keyboard instead. In that case I’d encourage you to try it out before buying, to see if the sound quality seems good to you, and to choose one which is full scale – it doesn’t need to have the full octave range of a grand piano, but you don’t want one of the “toy-like” keyboards where the keys are physically smaller than real piano keys.
I hope that helps!