How can I take a screenshot on an iPhone while Guided Access is on?
You can use the AssistiveTouch feature built into iOS. AssistiveTouch gives you a software equivalent of Home button which can be used to perform a variety of device operations.

To enable AssistiveTouch go to Settings app → General → Accessibility → AssistiveTouch.



Once enabled, you'll notice a gray colored translucent overlay button on your device screen. Tap on the AssistiveTouch button → Device → More → Screenshot to capture a screenshot without touching any physical button on your device.







The captured screenshot can be viewed in the Photos app normally.