My question is similar to https://quant.stackexchange.com/questions/37419/replicate-a-portfolio-with-given-payoff but I am not quite sure how to apply this to my problem.
A portfolio of European call options on an asset $S$ has a payoff function given by $V_T$ where $$V_T = 0,\ S < A$$ $$V_T = S - A , \ A \leq S \leq B$$ $$V_T = B - A, \ S > B$$
(i) Construct a portfolio $H_1$ of European call options with this payoff function.
(ii) Use Put-Call parity to construct a portfolio $H_2$ of European put options with this payoff function.
This is known as a call spread. Buy one call at strike $A$ and sell one call at strike $B$ for part (i). Once you know (i), you should be able to get (ii). Also see the sections at this Wikipedia page.