From the MySQL documentation at the Working with null values page:
The NULL value can be surprising until you get used to it. Conceptually, NULL means “a missing unknown value” and it is treated somewhat differently from other values.
since NULL is "unknown", the comparison NULL = NULL will be unknown as well and will return NULL, and since NULL is not TRUE your function will return 'false'.
You could use IS NULL operator:
SELECT IF(NULL IS NULL, 'true', 'false')
or you can also use then NULL-safe equal to operator:
SELECT IF(NULL <=> NULL, 'true', 'false')