Yes, and maybe
The use of "CR" is an out-of-game term and there really isn't a way to learn that specific value using in game rules.
But what you may really be asking about is whether it is possible to gauge the difficulty of a fight before going in. There are two possible answers to this:
Yes, a Battlemaster Fighter or Mastermind Rogue can (functionally)
Battlemaster Fighter
The 7th level class ability Know Your Enemy grants you (PHB, 73-74)
Starting at 7th level, if you spend at least 1 minute observing or interacting with another creature outside combat, you can learn certain information about its capabilities compared to your own. The DM tells you if the creature is your equal, superior, or inferior in regard to two of the following characteristics of your choice: [Strength, Dexterity, Constitution, AC, Current HP, Total class levels (if any)]
Mastermind Rogue
The 9th level feature insightful manipulator provides a similar ability(Xanathar's, 64):
Starting at 9th level, if you spend at least 1 minute observing or interacting with another creature outside combat, you can learn certain information about its capabilities compared to your own. The DM tells you if the creature is your equal, superior, or inferior in regard to two of the following characteristics of your choice:
- Intelligence score
- Wisdom score
- Charisma score
- Class levels (if any)
At the DM’s option, you might also realize you know a piece of the creature’s history or one of its personality traits, if it has any.
Your DM should communicate with you
Depending on your level, you are a seasoned or somewhat seasoned adventurer. A DM could provide a basic gut instinct on creatures/scenarios they expect you to engage in or expect you to be wary of. However, there may be times where you want to take the risk or forego an easy win that may complicate this.
My table (and also suggested by W.Gering), often allows for a searching of player knowledge vs a history/arcana/nature/religion type check (depending on the monster type.) Setting a DC for various levels of knowledge is an option for you and your players.