Select in a PostgreSQL function
You have two errors: 


apparently brand is defined as text, not varchar
set returning functions have to be used like a table in the FROM clause.


So you need to change your function definition to:

CREATE OR REPLACE FUNCTION getcars() 
   RETURNS TABLE (car_name text, id_car INT) 
AS $$
BEGIN
   RETURN QUERY 
   SELECT brand,car_id
   FROM cars;
end;
$$ 
LANGUAGE plpgsql;


And then use it like this:

select *
from getcars();




Simple functions that just return a query are better defined as language sql:

CREATE OR REPLACE FUNCTION getcars() 
   RETURNS TABLE (car_name text, id_car INT) 
AS $$
   SELECT brand,car_id
   FROM cars;
$$ 
LANGUAGE sql
stable;