When you add the parenthesis to the functions, the functions are called immediately and the result, in this case undefined, is returned to addEventListener.
You want to reference the functions, not call them
next.addEventListener("click", next, false);
prev.addEventListener("click", prev, false);
The next error is that you're using the same names for the variables and functions, so when you say next.style
it's now the function, not the element, as the function name overwrites the variable
var next_elem = document.getElementById("next");
var prev_elem = document.getElementById("prev");
next_elem.addEventListener("click", next_fn, false);
prev_elem.addEventListener("click", prev_fn, false);
function next_fn(e) {
e.preventDefault();
prev_elem.style.display = "block";
next_elem.style.display = "none";
}
function prev_fn(e) {
e.preventDefault();
prev_elem.style.display = "none";
next_elem.style.display = "block";
}