Well - nowadays, the publishing bit means finding an aggregator or distributor - like distrokid, sontradr, ditto or dozens of others. You give them the music and it appears on all the platforms. Takes about three weeks then anyone in the world can stream or buy it.
Copyright is yours from the day you create it. The reality is that you need to make sure that when people shazzam your song, you come up as the author/singer/arranger or whatever. If you wish, you can join your countries rights organisation. PRS in my case, ASCAP in the US and they too will protect and enhance your product - they catch things like radio play, or live performances of it.
At the very least, if you do this, and somebody sticks it on youtube, YOU get any royalties because the system knows what it is and who it belongs to. You won't get rich, but the song will be yours, officially.