Suppose an option payoff function $$max(min(S-1, 2-S), 0)$$ To value such an option, one would decompose this function, for example, as follows: $$max(S-1, 0) - max(2S-3, 0) + max(S-2, 0)$$ Now, it can be valued using the Black-Scholes formula.
How is this decomposition (or any other solution, for that matter) obtained?
I imagine one would start by graphing the payoff function. However, I was not able to come up with any sensible solutions by using this method.
Thank you very much!