- What role does SHA256 or other hash families play?
A cryptographic hash function (such as SHA256) takes an arbitrary long input, and converts it into a fixed length string such that:
Given an output of a hash, it is hard to find an input that hashes to that ("preimage resistance")
Given a string, it is hard to find a different input where both inputs hash to the same value ("second preimage resistance")
It is hard to find two different inputs that hash to the same value ("collision resistance")
A hash function is a quite useful tool when creating larger cryptographical objects. The standard example is signing: public key signature algorithms typically can't take arbitrary length inputs, while we might want to sign quite large objects. What we do is apply the hash function to the object, and have the actual public key algorithm sign the hash - because it is hard to find a second object that hashes to the same value, then we know that if the signature verifies (and the hash is what it was originally), we know that it also must be the original large object.
Why are they needed when we have LWE, McEliece etc?
That we very much a "why do we need screwdrivers when we have hammers" - it's because they serve different functions
- What happens if only SHA2 family including SHA256 is broken? Will we still have online finance and the internet?
Well, that's actually happened before; with both MD5 and SHA-1, collision resistance has been broken - the industry migrated to other hash functions (chiefly SHA-2). What we'd do is migrate again, probably to SHA-3 (which is quite different internally - it is quite unlikely that the same cryptographic finding would apply to both SHA-2 and SHA-3)