Is "swimming" a gerund in "I went swimming"?
This is admittedly a construction where the distinction between participles and gerunds is at its weakest. No grammatical distinction works out 100 % of the time. However, in traditional dependency grammar, this is probably analysed as a participle by most people. The reason for that choice is that it is very similar to the way the verb go can take predicative adjectives (to go insane, see below), and a participle is adjectival (whereas a gerund functions like a noun).
Those who accept a distinction between gerund and present participle in English agree that a gerund is like a noun, whereas a participle is like an adjective. A noun can be the direct object of a transitive verb, an adjective normally cannot; an adjective can modify a (pro)noun, which a noun normally cannot (except as a noun adjective, which is irrelevant to the construction in question).
You can go first, you can go berserk, you can go insane, you can go free, and you can go many other things. These words are all adjectival. The traditional term for this special use of adjectives with verbs of movement is predicative; it is akin to more common predicative expressions, like subject complements with copulae (to be first, appear insane) and object complements with certain verbs (to paint something black, to consider someone insane).
Predicative adjectives are analysed as a category of words that are on the one hand used as adjectives, in that they clearly ascribe a property to a noun or pronoun: in the dog went insane, the entity the dog acquires the property insane; but on the other hand they function like adverbs, in that they can be said to describe the "way" in which the verb happens: the insane dog went (i.e. with an attributive adjective) is not what you're saying when you say the dog went insane (predicative). The latter rather means "the dog went in such a way as to behave insanely" (adverbial), not *"there was an insane dog that went" (attributive).
Because to go berserk and to go swimming are similar in so many ways, swimming is best analysed as adjectival, so a participle rather than a gerund.
Can we find a way to analyse it as a gerund? Consider she began swimming. Here swimming is a gerund; is this not similar to she went swimming? Yes, and no.
You can say she began her trip. The verb begin can normally take an object (trip) with the semantic role of a Theme ("that which undergoes an action") or possibly a Manner or Purpose, depending on how you analyse the semantic role of trip. It is evident that she began her trip and she began swimming are very similar: both have a direct object, and the semantic role of the object seems identical. This "proves" that swimming is a gerund in she began swimming: it functions just like a noun.
But this does not work with go. You can go swimming, but you cannot go a trip. You cannot use a direct object as a goal or destination: you need a prepositional phrase instead, like on a trip, to Athens, after him. How can swimming be a gerund if you cannot replace it with a noun in the same syntactical position (direct object) with the same semantic role? Then you would have to posit a new, special predicate frame ("use of a verb with certain kinds of arguments") only for go + -ing.
The alternative is to compare the syntax and semantics of go swimming to go insane and treat them as the same construction: go + predicative adjective, where a participle can function as an adjective. That way, you can connect go + ing to something other than -ing forms, as opposed to the special predicate frame rejected above. I makes more sense and escapes Occam's Razor.
I would say it clearly is a gerund because older forms show the remainder of a preposition prefixed to the gerund as in
1 We went a-hunting.
This can only be "We went to (the) hunting. German still has the comparable form in
2 Wir gingen zum Jagen (zum = zu dem).
Literal word-for-word translation: We went to the hunting ( no idiomatic English).
As to the sentence part of swimming it is an adverbial part indicating where to or better what for (indicating purpose).
You could transform the sentence into
3 We went off for the purpose of swimming.