The poem "The Shadow" by Scottish poet and novelist Robert Louis Stevenson was originally published as part of the poet's 1885 collection of children's poetry, A Child's Garden of Verses.
The poem is written in first person, in slightly irregular rhyming couplets organized into four-line stanzas. We can deduce the identity of the speaker by looking at the actions the speaker is performing and the pronouns the speaker uses.
Since the speaker refers to the shadow as "he", we can assume that the speaker is male. The main activities in which the speaker is engaged are "jumping" into bed and going out to play. These activities suggest that the speaker is a child. That impression is confirmed by the way the speaker contrasts the behavior of the shadow with the behavior of "proper children".
A more specific sense of the child's age is suggested in the third stanza:
He hasn't got a notion of how children ought to play, ...
I'd think shame to stick to nursie as that shadow sticks to me!
The term "nursie", in late nineteenth century context, suggests that the child is under seven years old, and still in the nursery, rather than old enough to go to school. Thus we can conclude that the speaker is a young boy.