It isn't mandatory, although during tournaments you will likely need to mark your ball to allow another player to hit their shot. In this instance having a ball marker is vital as it means that you can easily provide your playing partner with a direct line to the hole without impeding them. Not marking your ball could be considered unsportsmanly and you may incur a penalty depending on club rules.