Problem with pcf8574

I would check to see which library you are actually using. There are pcf8574 and PCF8574 (note case) in the library manager and they are different from the GitHub one you reference.

Also the pinmode() should probably be set after the begin().