You need some parentheses around the list pattern:
getelem 0 (x:xs) = x
getelem n (x:xs) = getelem (n - 1) xs
By terminating on 0 you have made the function count elements from 0, rather than from 1 (as was suggested in the original post). I think starting from 0 is a better choice though :-)