The issue lies in the LANGUAGE SQL declaration in your function definition, it's working fine - please check :
CREATE OR REPLACE FUNCTION add(integer, integer) RETURNS integer LANGUAGE 'sql' AS 'select $1 + $2;' RETURNS NULL ON NULL INPUT COST 100;