Error communication in I2C in PIC32
If you don't have external pull-up resistors as mentioned in the comments, you can try to enable the internal pull-ups - it's hard to find an actual value on them, but if the quoted 50µA in the data sheet are related to the pull-ups they would be around \$66k\Omega\$. Those values are a bit high, but with a slow I²C clock they should be fine. Outside of the official I²C specification, so no guarantee they will work, have a look at page 55.
To enable those you can use the change notification functions of the peripheral library (here) on the SDA and SCL pins. I'm not 100% sure if that will work (not a PIC expert), the description of the I²C module sounds like it could override all I/O pin settings (here):

Enabling I 2 C I/O
Two pins are used for bus operation: the SCLx pin, which is the clock, and the SDAx pin, which
is the data. When the I 2 C module is enabled, assuming no other module with higher priority has
control, the module will assume control of the SDAx and SCLx pins. The module software need
not be concerned with the state of the port I/O of the pins, the module overrides, the port state,
and direction. At initialization, the pins are tri-state (released).

Even if that works, putting external pull-up resistors is recommended as you can change the value if your I²C bus grows larger or you have noise issues.
The schematic you posted in your comment is fine (note: C1 is used as a decoupling capacitor for the RTC supply pin, and should be placed as closely to the pin as possible). I wonder what kind of connection / schematic you used until now.