You don't seem to join the tables you are trying to update from. I think the query will need to be converted to this:
UPDATE car_check
set fencing=foo.ST_Contains
from (
SELECT ST_Contains(ST_AsText(p.geom),
ST_GeomFromText('POINT(' || to_char(t.lat, '9999.999999') || ' ' || to_char(t.log, '9999.999999') || ')') AS ST_Contains, cc.carid, cc.cargroupid
FROM test t INNER JOIN car_check cc ON t.id = cc.carid
INNER JOIN rule r ON cc.cargroupid = r.cargroupid
INNER JOIN poly p ON r.polyname = p.polyname
WHERE p.poly_version = (SELECT MAX(p1.poly_version) FROM poly p1 WHERE p1.polyname = p.polyname))as foo
INNER JOIN car_check
ON foo.carid = car_check.carid AND foo.cargroupid = car_check.cargroupid
where carid='AD-5487' and cargroupid='1'
(I have no idea how your last table is called. The name is cut off from the picture. I called it poly in my statement. Fix it in yours)