As far as urban slang, the definition is "to show off." Used by many rappers, most notable Ice Cube and the Geto Boys. Originated in the urban community, and has been used for quite some time.
"...no flexin', didn't even look in the nearest direction as I ran the intersection. (This is said because Ice is trying to get away from some people who tried to kill him the other day In the song, of course)" -Ice Cube, "It Was a Good Day"
person 1: "im so dedicated to football, I just smashed out a great training sesh im so good. like the academy just made me pro u should've seen me repping the goals at training today . plus my brows r on fleek today. also did u know also there's a town in Germany called Burmeister."
person 2: "geez that guy is such a flexer, I bet his name is jai"
This can be loosely used to describe a mood, situation or routine behaviour (usually social).
2) (verb); to act out these behaviours or moods.
This is often associated with (but not limited to) exhibiting dominance in prowess of either physical strength (e.g. muscle size by FLEXING your arms) or cultural knowledge - namely dressing and dancing to impress and demonstrating a superior capability of use of language.
This is usually a playful display and is a part of innocent courtship, although it can be taken to mean a more sinister and aggressive stance.
1) "I was ballin all evening with my homies until we hit the club flex to find some fly bitches"
or
"That mad cat was on a mental flex, kicking off at blokes in the street if they so much as looked at him"
or
"The author of this article was on a bored flex at the time of writing"
2)"I was flexing with this chick till her man comes along and drags her off"
or
"I like to flex when I've had a sip or two of yak"