1) $p \to (q \to r)$ --- assumed [a]
2) $p \to q$ --- assumed [b]
3) $p$ --- assumed [c]
4) $q$ --- from 3) and 2) by $\to$-elim
5) $q \to r$ --- from 3) and 1) by $\to$-elim
6) $r$ --- from 4) and 5) by $\to$-elmi
7) $p \to r$ --- from 3) and 6) by $\to$-intro, discharging [b]
> 8) $(p \to q) \to (p \to r)$ --- from 2) and 7) by $\to$-intro, discharging [b]
>
>> 9) $(p \to (q \to r)) \to [(p \to q) \to (p \to r)]$ --- from 1) and 8) by $\to$-intro, discharging [a].
As you can see, we have to assume all the antecedents of the conditionals involved.