Blockchains are known to be immutable because all transactions of cryptocurrencies and state (data) changes. However, looking at ethscan does not provide any information on the output of a smart contract function that results in a state change. Is there a way to monitor the historic values of a state and if so how to do so?
There are two ways you could potentially track how a state vatiable has changed over time:
1- The contract has been developed so that when said variable is modified its previous state is added to an array which contains all previous states.
2- the contract has been developed so when the state variable is modified it fires an Event that logs said transaction. Here's more info about how to retrieve the logs. How can I view event logs for an ethereum contract?
Both depend on the developer of the contract caring for keeping track of previous values either by storing them or logging it.
There's a third method. You can scan the chain looking for transactions on the contract and querying the state of that variable at each transaction of interest. I'm not saying it's easy--in fact, it's exceptionally difficult given the way the data is stored--but you could do it. I call this idea "off-chain monitoring" of smart contracts.
To add to @pabloruiz55 's answer, I wanted to suggest yet another alternative that I think is better than storing an array, as it is O(1) in the number of historical updates: use a backwards linked list of ipfs hashes. Rather than storing the state variable itself on the smart contract, you store it on ipfs and then put it's hash in the smart contract. In addition to storing the content of the state variable on the ipfs file, you also store the hash of the previous ipfs state file in the next ipfs file. That way, you only need to store the hash of the most recent state variable on the smart contract, but you can recursively recover all of the previous states simply by querying that backwards linked list (or hash chain) that is stored off-chain on ipfs. The sequence of states stored off chain is cryptographically guaranteeed to have the same order as the real history of hashes that were pushed to the blockchain.