Prove correctness of recursive multiplication algorithm

I'm in a first year discrete math course and we started algorithms. I created a recursive algorithm to multiply two numbers together:

function multiply($n,$r) {
if($n == 1) return$r;
else if($r == 1) return$n;
else