I think the issue is that of given the choice between something with a sell-by date a few days in the future or 10-15 days in the future at the same cost, nearly everyone is going to take the food with the better date. Which means the arrival of a new batch of inventory makes the older inventory barely salable.
Technical solutions could help here: it is taxing on humans and most POS systems to have to adjust the price of older inventory, but if that could be done automatically (or the labor pushed onto the customer to identify the condition in exchange for a discount) people looking for deals might help reduce this type of waste.
That's a pretty good idea aid seems it could be solved entirely by software (+some signs for awareness).
That's technically illegal. Grocery stores are not allowed to repackage pre-packaged food. We have strict food-handling regulations in place to protect consumers, which is part of what makes food waste such an issue.