I thought of a different way that does not require the dates to be in any particular order, does not require checking for the row, does not reference any specific cell in another row (only the entire column), there can be gaps in the data, and you can add/delete/move rows (in case you missed entering a day or entered one twice or out of order) without it breaking the formula. One formula is for the earliest date of the month, one for the latest day of the month, and one that does both.
First date:
C2 =IFS(B2="","",B2=MINIFS(B,B,">"&EOMONTH(B2,−1),B,"<="&EOMONTH(B2,0)),"First day of month",TRUE,"")
Last Date:
D2 =IFS(B2="","",B2=MAXIFS(B,B,">"&EOMONTH(B2,−1),B,"<="&EOMONTH(B2,0)),"Last day of month",TRUE,"")
Both combined (if a date is both first and last, the result will be "first"):
C2 =IFS(B2="","",B2=MINIFS(B,B,">"&EOMONTH(B2,−1),B,"<="&EOMONTH(B2,0)),"First day of month",B2=MAXIFS(B,B,">"&EOMONTH(B2,−1),B,"<="&EOMONTH(B2,0)),"Last day of month",TRUE,"")
IFS is like a collection of if then else statements. IFS(first condition, do this if TRUE else continue to next one, second condition, do this if TRUE else continue to next one, and so on)
For the first day of the month it finds the minimum date that is > than the last day of the previous month and <= the last day of the given month. If the date is the same as that minimum date then it is the first day of that month.
For the last day it finds the maximum date that is > than the last day of the previous month and <= the last day of the given month. If the date is the same as that maximum date then it is the last day of that month.
The initial test for ="" is for if the cell is blank. The rest of the formula does not work correctly on blank cells.