SELECT MIN(id), MAX(id) FROM tabla
EDITAR: Si necesita recuperar los valores de la fila, puede hacer esto:
SELECT *
FROM TABLA AS a, (SELECT MIN(id) AS mini,
MAX(id) AS maxi
FROM TABLA) AS m
WHERE m.maxi = a.id
OR m.mini = a.id;