In American football, sometimes on long field goal attempts the defending team positions a player in the end zone in case the kick is short. Suppose the ball were to hit an upright, carom off this player's helmet, then bounce back through the uprights. Would this be a field goal?
Yes, if it is a defensive player.
The rules require three things.
SECTION 4 - FIELD GOAL ARTICLE 1. SUCCESSFUL FIELD GOAL A field goal is scored when all of the following conditions are met:
(a) The kick must be a placekick or dropkick made by the offense from on or behind the line of scrimmage or from the spot of a fair catch (fair-catch kick). If a fair catch is made or awarded outside the inbound line, the spot of the kick is the nearest inbound line.
(b) After the ball is kicked, it must not touch the ground or any player of the offensive team before it passes through the goal.
(c) The entire ball must pass through the vertical plane of the goal, which is the area above the crossbar and between the uprights or, if above the uprights, between their outside edges. If the ball passes through the goal, and returns through the goal without striking the ground or some object or person beyond the goal, the attempt is unsuccessful.
It may be assumed that condition (a) is true for the purposes of this question.
Condition (b) is not otherwise false.
The first half of condition (c) may be assumed to be true, and the second half to be false, for the purposes of the question.
Condition (b) is the only problematic point, however as a defensive player is neither the ground nor an offensive player, they do not prevent the goal being stored just by touching the ball.
This should be obvious by comparison, as field goals may be scored if they are deflected by a defensive player near the line of scrimmage or the spot of the kick. The rules are designed to allow the irregular but expected case of a defensive deflection; they evidently don't consider the improbable case posed in the question.