“your painted counterfeit”
'Counterfeit' here means a portrait — a painted likeness, not a fraud. The word carried both senses in Elizabethan English: something made to resemble the original, whether deceptively or artistically. The poet argues that 'living flowers' (children) are 'much liker' to the Youth than any painted portrait or poem, because a child inherits actual life, not merely the appearance of it.
“the lines of life that life repair, Which this, Time's pencil, or my pupil pen”
'Lines of life' puns on two meanings: the lines of verse written by a poet, and the line of descent — the lineage carried on by children. The sonnet has been arguing that verse ('my pupil pen') cannot truly preserve the Youth; now it offers that only the 'lines of life' — children who carry the Youth's living form — can 'repair' (restore, make good) the damage Time inflicts. 'Time's pencil' refers to a portrait-brush, since 'pencil' meant a fine-pointed brush in Elizabethan English.
historical The sonnet form“To give away yourself, keeps yourself still, And you must live, drawn by your own sweet skill”
The closing couplet states the paradox at the heart of the procreation argument: to give yourself away — to spend yourself in having children — is the one way to keep yourself. The child preserves the parent's form. 'Drawn by your own sweet skill' continues the painting metaphor: only the Youth can produce a true likeness of himself, by fathering a child — no poet's or painter's art can match it.
historical The procreation argument (Sonnets 1-17)