You have to think in the cases, this function does the trick:
isPalindrome [] = True
isPalindrome [x] = True
isPalindrome [x,y] = x == y
isPalindrome xs = (head xs) == (last xs) && isPalindrome ((tail . init) xs)
With an example:
isPalindrome "aabaa" -->
isPalindrome "aabaa" = (head "aabaa") == (last "aabaa") && isPalindrome ((tail . init) "aabaa")
next step)
isPalindrome "aabaa" = ('a') == ('a') && isPalindrome "aba"
next step) isPalindrome "aba"
(head "aba") == (last "aba") && isPalindrome ((tail . init) "aba")
next step ->
('a') == ('a') && isPalindrome "b")
last step ->
isPalindrome "b"
isPalindrome [x] = True
so we have the expression:
('a') == ('a') && ('a') == ('a') && True --> True