Is this phrase an appositive? And what case for the pronoun - We or Us?

Solution 1:

It is an appositive construction, with 'both we students and the society' an explanatory restatement of the initial 'We'.

Substituting,

"Both we students and the society should do something."

is seen to be correct (if necessary, shorten to "We and the society should do something." v "Us and the society should do something."). The appositive (restated version) should be the same part of speech as, in the same case as (where relevant), or the same construction (prepositional phrase, clause ...) as the string it mirrors.

This sort of construction often sounds a bit over-formal and is perhaps better rephrased.

Solution 2:

It seems to me that the sentence

We should do something, both we students and the society.

has a problem with inconsistent (and nested) "we"s: The second "we" explicitly refers to "students," in contradistinction to "the society." But the first "we," I think, just as clearly refers to both "we students" and "the society." If that were not the case, you would have to interpret the sense of the sentence as being something like this:

We students should do something—or more precisely, both we students and the society should do something.

In my view, there is no benefit to be gained from introducing the second "we," regardless of how the author wants the sentence to be understood, but especially not if it and the first "we" have different referents. A better approach would be to spell out the identity of the author's first "we" parenthetically, and not mention the second "we" at all:

We—by which I mean both students and society as a whole—should do something.

or (to the same effect):

We should do something—and by "we" I mean both students and society as a whole.

Alternatively, you could get rid of both "we"s:

Students and society as a whole should do something.