You can stick with your phone as
@Martinswede suggested. If it is indeed an Apple iPhone, you want to download GarageBand. Not sure what is available on Androids. Not sure what kind of interface you would need to record keyboard directly in to the phone, as opposed to the sound from the speakers, but I’m pretty sure the technology is available.
If you have acces to a computer, you’re probably better of going down this route, because it’s no doubt where you end up anyway.
If it’s and Apple Mac, go for GarageBand again, I think it’s free, and it’s perfect for what you want. Not sure what’s best or cheap on PC but I’ve heard good reports from people on here of Reaper.
To get you started on a computer you just need a few basic things: A digital audio workstation (DAW) such as GarageBand/Reaper, a digital/audio interface, a microphone, an audio and/or midi lead to connect keyboard to interface (and a lead for the mic) and a decent pair of headphones.
From there you will chop and change and add to your setup as necessary.
I’m pretty sure
@Boydie may be along shortly to offer you some more expert pointers, or I would recommend posting or looking through the threads on the recording page.
Yodasdad