Simple and supports NA's: mapply(identical, df$a, df$b):
mapply(identical, df$a, df$b)
Browse[1]> mapply(identical, c(NA, NA, 7, NaN), c(4, NA, 7, NaN)) [1] FALSE TRUE TRUE TRUE