No, pineapple does not need to be cooked before serving to babies. You should, however, make sure it is ripe enough that it is soft, or serve a firm core with little flesh on it.