In Chapter 6 of Nim's Island, Nim avoids telling Alex Rover about her father because she is trying to protect her feelings and maintain a sense of hope. Nim's father has gone missing, and she harbors a deep fear about his fate. She doesn't want to delve into the painful reality of her father's absence, as discussing it could make the situation more real and distressing for her.
Nim's relationship with her father is central to her identity and the story itself. By withholding information from Alex Rover, she is also subconsciously shielding herself from the vulnerability that comes with sharing her worries. In essence, Nim's choice to keep this part of her life a secret reflects her youth and the instinct to protect oneself from emotional pain.
Additionally, her interactions with Alex Rover, whom she perceives as a hero, create a desire to keep her father's situation separate from her admiration for Alex. This demonstrates how children sometimes compartmentalize their emotions as a coping mechanism, particularly in trying times.