You could put those functions into an array:
var functions = [ function1, function2, function3, function4 ];
and have an integer to keep track of the last executed function:
var index = 0;
Now when next is clicked you would invoke the function at the specified index in the array and increment it:
functions[Math.abs(index % functions.length)]();
index++;
When back is clicked do the same but decrement the index:
functions[Math.abs(index % functions.length)]();
index--;
The index % functions.length ensures that the returned value is always within the 0-3 range which is actually the allowed index range for your array.
nextis clicked and the last executed function was 4? Start all over?