I asked him not to play the piano late at night.

Literal

Night late piano [obj-を] not-play [purpose-ように] he [to-に] requested.

[Negative verb]+ように+頼む ('ask someone to not X') is the indirect request pattern. ~ように used with 頼む, 言う, 伝える marks the content of what's being requested. に marks the addressee of the request. An important way to report requests without direct quotation.