Is there a better way to return values with merge sort?
The expression merge(x,y) will always return a value. val r = merge(x,y) stores the value so that you can use it again.

You could write your code 

var leftTemp = mergeSort(left);
var rightTemp = mergeSort(right);

var result = merge(leftTemp, rightTemp)

result


as

merge(mergeSort(left),mergeSort(right))


It is a matter of preference if you wish to use leftTemp and rightTemp like this, but the use of result, and then returning it on the next line is not idiomatic Scala.

You must assign values to an identifier when you want to use them more than once (as you do with temp in your final example). But as I said above you may want to do this for other reasons such as readability and keeping down line lengths.